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
 1 #include <stdio.h>
 2 #include <string.h>
 3
 4 int main(){
 5     int T;
 6     int n;
 7     char s[81];
 8     int length;
 9     int time;
10     int i;
11
12     time=1;
13
14     scanf("%d",&T);
15
16     while(T--){
17         scanf("%d%s",&n,s);
18         length=strlen(s);
19
20         printf("%d ",time);
21         time++;
22
23         for(i=0;i<length;i++){
24             if(i+1!=n)
25                 printf("%c",s[i]);
26         }
27
28         printf("\n");
29
30     }
31
32     return 0;
33 }

转载于:https://www.cnblogs.com/zqxLonely/p/4087004.html

Mispelling4相关推荐

最新文章

  1. 无需标注数据集,自监督注意力机制就能搞定目标跟踪
  2. C++对象的内存分析(2)
  3. 查询存储过程所需参数
  4. JMeter学习笔记--JMeter监听器
  5. 什么是spring_Spring 源码第三弹!EntityResolver 是个什么鬼?
  6. 生活不是拍电影,不会在关键时刻有个人来救你。
  7. 扩散(洛谷-P1661)
  8. CQRS之旅——旅程6(我们系统的版本管理)
  9. win2008删除计算机用户,Windws Srv 2008内置账户
  10. java consumer.poll_java – 无法在kafka consumer下设置’max.poll.records’,其中cons.poll仍然返回分区下的所有记录...
  11. Ionic 学习笔记
  12. matlab绘图和python绘图
  13. Invest模型问题答疑--产水模块、土壤保持模块、供需平衡分析、生态系统服务、生物多样性生境质量
  14. 【译】2021年国外十大AI自动写作软件评测
  15. LYNC 2010 中文测试版已经可以下载
  16. 用PS做自己的个人LOGO
  17. vim三种工作模式 命令模式、编辑模式、末行(底行)模式
  18. HTML计算平均成绩,access计算平均值取整
  19. STM32CubeMX实现串口DMA中断通信
  20. PHP Laravel 队列技巧:Fail、Retry 或者 Delay

热门文章

  1. java对列表数据排序_如何在Java中对列表进行排序
  2. JUnit测试用例– Eclipse和Maven
  3. jsp错误处理页面_JSP异常处理– JSP错误页面
  4. java 数字 下划线_数字文字中的下划线– Java 7功能
  5. VS2022找不到Microsoft.Expression.Interactions.dll
  6. C++编程学到什么程度可以面试工作?
  7. 未来人工智能应用体现出的核心技术有哪些?
  8. vue使用laydate.js插件报错laydate.css: Invalid
  9. Swift 类与结构体
  10. Linux堆内存管理深入分析 (上半部)【转】