请补充main函数,该函数的功能是:从键盘输入一个字符串及一个指定字符,然后把这个字符及其后面的所有字符全部删除。结果仍然保存在原串中。 例如,输入“abcdef”,指定字符为‘e’,则输出“abcd”。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include <stdio. h> #define N 80 main ( ) { int i=0; char str [N]; char ch; clrscr ( ); printf{"/n Input a string:/n"); gets (str); printf("kn Input a charator;/n"); scanf ("%c", &ch); while (str [i] !=’/0’) { if (str [i]==ch) 【1】 【2】 ; } str[i]= 【3】 ; printf{"/n*** display string ***/n"); puts (str); }

题库:计算机等级考试 类型:填空题 时间:2017-07-03 16:58:55 免费下载:《填空》Word试卷

请补充main函数,该函数的功能是:从键盘输入一个字符串及一个指定字符,然后把这个字符及其后面的所有字符全部删除。结果仍然保存在原串中。 例如,输入“abcdef”,指定字符为‘e’,则输出“abcd”。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。 试题程序: #include <stdio. h> #define N 80 main ( ) { int i=0; char str [N]; char ch; clrscr ( ); printf{"/n Input a string:/n"); gets (str); printf("kn Input a charator;/n"); scanf ("%c", &ch); while (str [i] !=’/0’) { if (str [i]==ch) 【1】 【2】 ; } str[i]= 【3】 ; printf{"/n*** display string ***/n"); puts (str); }

请补充main函数,该函数的功能是:从键盘输入一个字符串及一个指定字符,然后把这个字符及其后面的所有字符全部删除。结果仍然保存在原串中。
 例如,输入“abc

本题关键词:数字字符串,符号数字试验,埃及金字塔,删字试验,个体指数,识别符号,数字化计划,文字部分,功效函数图,写字能力;

微信扫码获取答案解析
下载APP查看答案解析