Mispelling 1510

#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main()
{
 int t;
 cin>>t;
 int a = t;
 getchar();
 while(t--){
  string s;
  int n;
  cin>>n;
  getchar();
  getline(cin,s,‘\n‘);
  int len = s.length();
  string ss="";
  for(int i=0;i<n-1;i++){
   ss = ss + s[i];
  }
  for(int j=n;j<len;j++){
   ss=ss+ s[j];
  }
  
  cout<<a-t+1<<" "<<ss<<endl;
 }
}

时间: 2024-08-04 06:43:20

Mispelling 1510的相关文章

uva 1510 - Neon Sign(计数)

题目链接:uva 1510 - Neon Sign 题目大意:给定n个点,任意三点不共线,并且两两点之间有一条线,给定线的颜色.问说有多少个三角形三边同色. 解题思路:对于每个点,记录该点黑色边的数量和红色边的数量,考虑以该点为顶点的三角形,从红色边中选一条,黑色边中选一条,组成的三角形一定是不满足的.因为一个不同色三角形会有两个点满则,所以考虑了两次.用总的个数减掉不同色的即可. #include <cstdio> #include <cstring> #include <

CSU 1510 Happy Robot

1510: Happy Robot Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 19  Solved: 7 Description Input There will be at most 1000 test cases. Each case contains a command sequence with no more than 1000 characters. Output For each test case, print the case

URAL 1510. Order(map 数学啊)

题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1510 1510. Order Time limit: 1.0 second Memory limit: 16 MB A New Russian Kolyan likes two things: money and order. Kolyan has lots of money, but there is no order in it. One beautiful morning Kolyan

剑指Offers 题目1510:替换空格

题目1510:替换空格 题解报告:  水题,注意数据,我是用最简单的办法,一扫而替换,判断的时候注意,s[i]!=0,全局数组初始化默认为0,我开始用了strlen(s)判断,超了不少时,哎呀! #include <stdio.h> #include <stdlib.h> #include <string.h> char s[10000001]; int main() { while(gets(s)){ for(int i=0; s[i]!=0; i++){ if(s[

【HDOJ】1510 White Rectangles

这个题目很好,变形的题目也很多.简单DP. 1 /* 1510 */ 2 #include <cstdio> 3 #include <cstring> 4 #include <cstdlib> 5 6 #define MAXN 105 7 8 char map[MAXN][MAXN]; 9 int dp[MAXN][MAXN]; 10 11 int min(int a, int b) { 12 return a<b ? a:b; 13 } 14 15 int ma

java 15-10 List的三个子类的特点

List:(面试题List的子类特点) ArrayList: 底层数据结构是数组,查询快,增删慢. 线程不安全,效率高. Vector: 底层数据结构是数组,查询快,增删慢. 线程安全,效率低. LinkedList: 底层数据结构是链表,查询慢,增删快. 线程不安全,效率高. List有三个儿子,我们到底使用谁呢? 看需求(情况). 要安全吗? 要:Vector(即使要安全,也不用这个了,后面有替代的) 不要:ArrayList或者LinkedList 查询多:ArrayList 增删多:Li

BZOJ 1510: Kra-The Disks

Johnny 在生日时收到了一件特殊的礼物,这件礼物由一个奇形怪状的管子和一些盘子组成. 这个管子是由许多不同直径的圆筒(直径也可以相同) 同轴连接而成. 这个管子的底部是封闭的,顶部是打开的. 下图是由直径为: 5cm, 6cm, 4cm, 3cm, 6cm, 2cm and 3cm 的圆筒组成的管子.  每个圆筒的高度都是相等的, 玩具中所带的盘子也是一些高度和它们相同的圆筒,直径有大有小. Johnny 发明了一种游戏,把盘子从管子顶部一个接一个的扔下去,他想知道最后这些盘子落在了哪,假设

倒着处理的思维--包含字符串匹配和九度1510 替换空格 剑指offer03

倒着来是处理字符串等的一个不错的技巧.举个例子,和这道题无关的,但是难度和意义都是更好的. 比如非完全匹配,就是差一个字符不匹配 那么其实有一种复杂度还不错的做法: 模式串:aacb 需要匹配的字符串: 1.aamb 2.acb 3.aamdb 这个时候其实可以先正向匹配,算出来匹配的字符的个数p1,再反向匹配,算出来匹配的个数p2,然后看p1+p2与模式串的长度的关系 恩,以上...还没做过具体题目 再看这道题,也是倒着处理字符串的思路:O(n)处理掉 #include <cstdio> #

10.15-10.18 iptables filter表案例 iptables nat表应用

七周四次课(3月22日) 10.15 iptables filter表案例 10.16/10.17/10.18 iptables nat表应用 扩展1. iptables应用在一个网段  http://www.aminglinux.com/bbs/thread-177-1-1.html2. sant,dnat,masquerade   http://www.aminglinux.com/bbs/thread-7255-1-1.html3. iptables限制syn速率  http://www.