Problem Description
Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string.
 
Input
The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow.
Each dataset
consists of a single line of input containing M, a space, and a single word made
up of uppercase letters only. M will be less than or equal to the length of the
word. The length of the word is guaranteed to be less than or equal to 80.
 
Output
For each dataset, you should generate one line of
output with the following values: The dataset number as a decimal integer (start
counting at one), a space, and the misspelled word. The misspelled word is the
input word with the indicated character deleted.
 

Sample Input

4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON
 
Sample Output
1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON
 
 #include <stdio.h>
#include <string.h> int main(){
int T;
int n;
char s[];
int length;
int time;
int i; time=; scanf("%d",&T); while(T--){
scanf("%d%s",&n,s);
length=strlen(s); printf("%d ",time);
time++; for(i=;i<length;i++){
if(i+!=n)
printf("%c",s[i]);
} printf("\n"); } return ;
}
 

Mispelling4的更多相关文章

  1. (erase) Mispelling4 hdu1984

    Mispelling4 Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. HDOJ/HDU 1984 Mispelling4(删除第n个字符~)

    Problem Description Misspelling is an art form that students seem to excel at. Write a program that ...

随机推荐

  1. 转】使用log4jdbc记录SQL信息

    原博文出自于: http://www.cnblogs.com/xdp-gacl/p/4081848.html 感谢! 一.log4jdbc的简单介绍 使用log4jdbc在不改变原有代码的情况下,就可 ...

  2. CISCO ASA 防火墙 IOS恢复与升级

    在IOS被误清除时的处理办法: 1.从tftp上的ios启动防火墙 防火墙启动后 ,按“ESC”键进入监控模式 rommon #2> ADDRESS=192.168.1.116 rommon # ...

  3. JavaScript 核心参考教程 内置对象

    这个标准基于 JavaScript (Netscape) 和 JScript (Microsoft).Netscape (Navigator 2.0) 的 Brendan Eich 发明了这门语言,从 ...

  4. mysql show命令集合

    a. show tables或show tables from database_name; -- 显示当前数据库中所有表的名称b. show databases; -- 显示mysql中所有数据库的 ...

  5. POJ 3254 Corn Fields (状压dp)

    题目链接:http://poj.org/problem?id=3254 给你n*m的菜地,其中1是可以种菜的,而菜与菜之间不能相邻.问有多少种情况. 状压dp入门题,将可以种菜的状态用一个数的二进制表 ...

  6. ZOJ1648 Circuit Board(线段相交)

    裸的判断线段相交

  7. HDU 4596 Yet another end of the world (数学,扩展欧几里德)

    题意:给出n组x,y,z.判断是否存在一个id使得id%x1∈(y1,z1),id%x2∈(y2,z2). 析: 设 id/x1=a , id/x2=b ,则 id-a*x1=u;   (1) id- ...

  8. 编译安装-Nginx

    安装Nginx 1.环境准备 2.创建nginx用户 3.安装pcre-8.33.tar.gz 4.安装nginx-1.5.4.tar.gz 6.开机自启动 安装Nginx 1.环境准备 系统:Cen ...

  9. C#POP3协议实现SSL验证登陆GMAIL

    最近在折腾POP3协议,登陆pop.qq.com和pop.163.com没有什么问题,于是就想着登陆pop.gmail.com,结果失败了.经查,发现gmail的pop3端口不是110,而是995.于 ...

  10. Unity3d:编辑器中运行正常,发布后的exe提示找不到文件

    解决方案1:查看文件路径拼写方式,如果是用“+”拼接的,请改用System.IO.Path.Combine()方式拼接.经过测试,两种拼接方式打印出来的路径是一样的,但为什么 加号 的方式拼接unit ...