网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
浙大OJ 2987Misspelling WA 坐等专家指教

Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string. InputThe 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. OutputFor 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 Input44 MISSPELL1 PROGRAMMING7 CONTEST3 BALLOONSample Output1 MISPELL2 ROGRAMMING3 CONTES4 BALOON我的代码#include<stdio.h>#include<string.h>int main(){ int n,i,m,k,j,char[90]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); getchar(); scanf("%s",&ch); j=0; for(k=0;ch[k]!='\0';k++) { if(k!=(m-1)) { j=j+1; ch[j]=ch[k]; // 这个地方 我有点小疑问 如果m=4 那么 ch[1]=ch[0],ch[2] } ]=ch[1] ch[3]=ch[2] ch[4]=ch[4];ch[5]=ch[5]....... 最后 在 } 输出ch的时候 ch[0] =ch[1],这个地方不是会有重复吗? (新手问的问题可能有点白痴 呵呵) printf("%d\n",k+1); printf("%s\n",ch); } return 0;}


参考答案

更多 “ 浙大OJ 2987Misspelling WA 坐等专家指教 Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string. InputThe 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. OutputFor 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 Input44 MISSPELL1 PROGRAMMING7 CONTEST3 BALLOONSample Output1 MISPELL2 ROGRAMMING3 CONTES4 BALOON我的代码#includestdio.h#includestring.hint main(){ int n,i,m,k,j,char[90]; scanf("%d", for(i=0;in;i++) { scanf("%d", getchar(); scanf("%s", j=0; for(k=0;ch[k]!='\0';k++) { if(k!=(m-1)) { j=j+1; ch[j]=ch[k]; // 这个地方 我有点小疑问 如果m=4 那么 ch[1]=ch[0],ch[2] } ]=ch[1] ch[3]=ch[2] ch[4]=ch[4];ch[5]=ch[5]....... 最后 在 } 输出ch的时候 ch[0] =ch[1],这个地方不是会有重复吗? (新手问的问题可能有点白痴 呵呵) printf("%d\n",k+1); printf("%s\n",ch); } return 0;} ” 相关考题
考题 ()是指教研组长协同其他组长、行政或者专家以小组的形式共同预备教研的一种准备策略。

考题 陕西户县有块地步知道适合做什么? 我们在户县有块地步知道适合种植什么?请专家指教.

考题 为什么PS文字使用索引颜色后变难看?请专家指教一下吧。一使用索引颜色后文字就变难看了

考题 以下()为人员数据表,用来记录工资变动后的数据。 A.WA_GZHZBB.WA_GZDataC.WA_GZFTD.WA—GZTblSet

考题 图a)体系的自振频率wa与图b)体系的自振频率wb的关系是: A. wab B. wa>wb C.wa=wb D.不能确定

考题 OJ可实现在线编译,在线判分。

考题 某理想气体从同一始态(p1,V1,T1)出发,分别经恒温可逆压缩和绝热可逆压缩至同一体积V2,若环境所做功的绝对值分别为WT和WA,问WT和WA的关系如何? (a) WT>WA (b) WT <WA (c) WT =WA (d) WT和WA无确定关系

考题 浙江大学西迁的经过被誉为?()A.文军西征B.浙大西迁C.文君长征D.浙大西征

考题 oj 1621 1624 1625