更多"下列程序的功能是将字符串s中所有的字符C删除。请填空。 #inclu"的相关试题:
[填空题]下列程序的功能是将字符串s中所有的字符c删除。请填空。
#include<stdio.h>
main( )
{char s[80];
int i,j;
gets(S);
for(i=j0;s[i]!’/0’;i++)
if(s[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([i]!=’C’)______;
s[j]=’/0’;
puts(s);
[填空题]下列程序的功能是将字符串s中所有的字符c删除。请填空。
#include<stdio.h>
main( )
char s[80];
int i,j;
gets(S);
for(i=j0;s[i]!’/0’;i++)
if(s[i]!=’c’)______;
s[j]=’/0;
puts(S);
[填空题]以下程序的功能是将字符串s中所有小写字母’a’删去,请填空。
#include<stdio.h>
main( )
{char s[]="absuWWUDJFKFLaaakdK";
int i,j;
for(i=j=0;s[i]!=’/0’;i++)
if( )
s[j++]=s[i];
s[j]=’/0’;
printf("%s",s);
}
[填空题]下面程序的功能是将字符串a下标值为偶数的元素由小到大排序,其他元素不变,请填空。
#include<stdio.h>
main( )
char a[]="labchmfye",t;
int i,j;
for(i=0;i<7;i+=2)
for(j=i+2;j<9;______)
if(______)
t=a[i]; a[i]=a[j]; a[j]=t;j++;
puts(a);
printf("/n");
[填空题]下面程序的功能是调用sub函数计算数组a中字符串的长度,请填空。
sub(char s[])
int n;
for(n=0; 【18】 n++);
return 【19】 ;
main( )
char*a;int k;
gets(a);
【20】
printf("%d",k);
[填空题]下列程序的功能是通过函数func输入字符并统计输入字符的个数。输入时用字符@作为输入结束标志,请填空。
#include<stdio.h>
long______;/*函数说明语句*/
main( )
long n;
n=func( );printf("n=%1d/n",n);
long func( )
long m;
for(m=0;getchar( )!=’@’;______);
return m;
[填空题]下面程序是把从终端读入的20个字符作为字符串放在字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;char s[21],*p;
for(i=0;i<20;i++)
s[i]=getchar( );
s[i]= 【12】 ;
p= 【13】 ;
while(*p) putchar( 【14】 );
[填空题]下列程序的功能是对输入的一行字符中的数字字符的字面值累加,输出此累加和,请填空。 #include<stdio.h> #include<ctype.h> main( ) char c; int a,s=0; while(______) if(isdigit(c)) a= c-’0’;s+=a; printf("s=%d",s);
[填空题]下列程序的功能是对输入的一行字符中的数字字符的字面值累加,输出此累加和,请填空。
#include<stdio.h>
#include<ctype.h>
main( )
char c;
int a,s=0;
while(______)
if(isdigit(C) )
a=c-’0’;s+=a;
printf("s=%d",s);
[填空题]下列程序的功能:对输入的一行字符中的数字字符的字面值累加,输出此累加和,请填空。
#include<stdio.h>
#include<ctype.h>
main( )
char c;
int a,s=0;
while(______)
if(isdigit(c))
a=c-’0’;s+=a;
printf("s=%d",s);
[填空题]下列程序的功能是对输入的一行字符中的数字字符的字面值累加,输出此累加和,请填空。
#include<stdio.h>
#include<ctype.h>
main( )
{ char c;
int a,s=0;
while(______)
if(isdigit(C) )
{a=c-’0’;s+=a;}
printf("s=%d",s);
}