第1题
第2题
第3题
例如,s所指的字符串为“def35adh3kjsdt7”,执行后结果为“defadhajsdt3537”。
请在程序的下划线处填入正确的内容并将下划线删除,使程序得出正确的结果。注意:部分源程序在文件BLANKl.c中。
不得增行或删行,也不得更改程序的结构!
第4题
第5题
请改正函数fun()中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
include <stdio.h>
include <conio.h>
void fun(char *s)
{int i,j;
for(i=0,j=0; s[i]!= '\0'; i++)
if(s[i]>= '0'&&s[i]<= '9')
/*************found**************/
s[j]=s[i];
/*************found**************/
s[j]="\0";
}
main()
{char item[80];
clrscr();
printf("\nEnter a string: ");gets(item);
printf("\n\nThe string is:\%s\n", item);
fun(item);
printf("\n\nThe string of changing is :
\%s\n",item);
}
第6题
第8题
第9题
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);
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!