填空题
数组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;
1; j++)
if(p[j]=="z"||p[j]=="Z")
p[j]-=
2;
else
p[j]+=
3;
}
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);
}