更多"以下程序的功能是:删除字符串中所有的空格。请填空。
#includ"的相关试题:
[填空题]以下程序的功能是:删除字符串中所有的空格。请填空。
#include<stdio.h>
main( )
char s[100]="Our teacher teach C language!"; int i, j;
for(i=j=0; s[i]!=’/0’; i++)
if(s[i]!=’’) s[j]=s[i]; j++;
s[j]=______;
printf("%s/n", s);
[填空题]以下程序的功能是计算字符串的长度。请填空。
#include<stdio.h>
main( )
{char str[100],*sp=str;
int nlen=0;
scanf("%s",str);
for(;*sp!=’/0’;sp++)______;
printf("%d",nlen);
}
[填空题]下面程序的功能是将字符串s中所有的字符a删除。请填空。
#include<stdio.h>
void main( )
{char s[80];
int i,j=0;
gets(s);
for(i=0;s[i]!=’/0’;i++)
if(s[i]!=’a’)______;
s[j]=’/0’;
puts(s);}
[填空题]下列程序的功能是将字符串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中所有的字符C删除。请填空。
#include<stdio.h>
main( )
char s[80];
int i,j;
gets(s);
for(i=j=0;s[i]!="/0";i++)
if([i]!=’C’)______;
s[j]=’/0’;
puts(s);
[填空题]下列程序的功能是将字符串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]=’/0’;
puts(s);
[填空题]以下程序用以删除字符串所有的空格,请填空。
#include <stdio.h>
main( )
char s[100]= "Our teacher teach C language!");int i,j;
for(i=j=0;s[i]!=’/0’;i++)
if(s[i]!=’’)s[j]=s[i];j++;
s[j]=______;
printf("%s/n",s);
[填空题]下面程序的功能是输出两个字符串中对应相等的字符。请填空。
#include <stdio.h>
char x[]="programming";
char y[]="Fortran";
main( )
int i=0;
while(x[i]!=’/0’&&y[i]!=’/0’)
if(x[i]==y[i])
printf("%c",______);
else
i++;
[填空题]以下程序用以删除字符串中所有的空格,请填空。
#include <stdio.h>
main( )
char s[100]="our teacher teach c language!”;int i,j;
for(i=j=0;s[i]!=’/0’;i++)
if(s[i]!=’’) s[j]=s[i];j++;
s[j]=______;
printf("%s/n",s);