填空题

下列程序的功能是将字符串s中所有的字符c删除。请填空。
#include <stdio.h>
main()
char s[80];
int i,j;
gets(s);
for(i=j=0;s[i] !=’\0’;i++)
if(s[i]!=’c’)______;
s[j]=’\O’;
puts(s);

【参考答案】

s[j++]=s[i]
<上一题 目录 下一题>
热门 试题

填空题
fun函数的功能是:首先对a所指的N行N列的矩阵,找出各行中的最大的数,再求这N个最大值中的最小的那个数作为函数值返回。请填空。 #include<stdio.h> #define N 100 int fun(int(*a)[N]) int row,col,max,min; for(row=0;row<N;row++) for(max=a[row][0],col=1;col<N;col++) if(______)max=a[row][col]; if(row==0)min=max; else if(______)min=max; return min;
填空题
以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串: abcl23edf456gh,执行程序后输出:123456。请填空。 #include<stdio.h> #include<ctype,h> main() char s[80],d[80];int i,j; gets(s); for(i=j=0;s[i]!=’ 0’;i++) if(______)d[j]=s[i];j++; d[j]=’ 0’; puts(d) ;
相关试题
  • fun函数的功能是:首先对a所指的N行N列的矩...
  • 下列程序的输出结果是______。 #in...
  • 计算机的运算速度可以用MIPS来描述,1MIPS...