题目内容
数组s全由字母字符组成,请补充fun()函数,该函数的功能是:把s中的字母转换成紧接着的下一个字母,如果原来的字母为“a”或“A”,则相应地转换成“b”或“B”,结果仍保存在原数组中。 例如,输入“aAZut”,则输出“bBAvu”。 注意:部分源程序给出如下。 请勿改动main()函数与其他函数中的任何内容,仅在fun()函数的横线上填写所需的若干表达式或语句。 试题程序: #include<stdio.h> #define N 100 void fun(char p[]) { int j; for(j=0; ______; j++) if(p[j]=="z"||p[j]=="Z") p[j]-=______; else p[j]+=______; } void main() { char s[N]; printf("Please Input a string: \n"); gets(s); printf("The original string: \n"); puts(s); printf("The new string: \n"); puts(s); }
查看答案
搜索结果不匹配?点我反馈
更多问题