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. Docker 入门教程(转)

    add by zhj: 可以简单的认为docker是对LXC(Linux Container)封装,它提供一种比LXC高级的API.Docker使用Go语言开发,利用了Linux提供的LXC,AUFS ...

  2. c++面试题总结(1)

    1.int a=5,则 ++(a++)的值是() A.5      B.   6          C.7       D.逻辑错误 a++返回的是一个临时变量,这里是右值,不能再前面++了 2.下面 ...

  3. Working with Other Node Types II

    [Working with Other Node Types II] An SKCropNode object does not directly render content, like a spr ...

  4. USB -- scsi命令集

    摘自:<圈圈教你玩usb> 241页 SCSI(small computer system interface)是小型计算机系统的缩写,有一套完整的协议规定其命令和命令数据的响应.scsi ...

  5. uestc oj 1217 The Battle of Chibi (dp + 离散化 + 树状数组)

    题目链接:http://acm.uestc.edu.cn/#/problem/show/1217 给你一个长为n的数组,问你有多少个长度严格为m的上升子序列. dp[i][j]表示以a[i]结尾长为j ...

  6. POJ 2386 Lake Counting (水题,DFS)

    题意:给定一个n*m的矩阵,让你判断有多少个连通块. 析:用DFS搜一下即可. 代码如下: #pragma comment(linker, "/STACK:1024000000,102400 ...

  7. VSTO安装部署(完美解决XP+2007)

    从开始写VSTO的插件开始,安装部署一直就是一个很大的难题,其实难题的原因主要是针对XP+2007而言.在Win7上,由于基本上都预装了.net framework,所以安装起来其实问题不大. 主要需 ...

  8. 备份Xcode6的配色主题以及代码模板

    ~/Library/Developer/Xcode/UserData/FontAndColorThemes ~/Library/Developer/Xcode/UserData/CodeSnippet ...

  9. ASP.NET MVC- UrlHelper的用法

    UrlHelper提供了四个非常常用的四个方法 1.Action方法通过提供Controller,Action和各种参数生成一个URL, 2.Content方法是将一个虚拟的,相对的路径转换到应用程序 ...

  10. openmp 并行求完数

    // GetWanShu.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "omp.h" #inclu ...