填空题
以下程序用以删除字符串中所有的空格,请填空。
#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);
【参考答案】
‘\0’
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
以下程序的功能是:借助指针变量找出数组元素中的最大值及其元素的下标值。请填空。 #include<stdio.h> main() int a[10], *p, *s; for(P=a; p-a<10; p++) scanf( %d , p); for(P=a, s=a; p-a<10; p++) if(*p>*s) s=______; printf( index=%d n , s-a);
点击查看答案&解析
填空题
下面的程序可对指定字符串中的字符串进行从大到小排序,请将程序填完整。 (注:程序采用了冒泡排序法) #include<stdio.h> #include<string.h> main() char*str= ABCDabcd ,temp; int n,i; n=strlen(str); while(n-->1) for(i=0;i<n;i++) if(str[i]<str[i+l]) temp= ; str[i]=str[i+l]; =temp; printf( );
点击查看答案&解析
相关试题
以下程序的运行结果是 。 #include <s...