阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #include <string.h> int fun(char*str) { int i,j=0; for(i=0;str[i]!='\0';i++) if(str[i]!='')str[j++]=str[i]; str[j]='\0'; } main() { char str[81];
A.asdafaaz67
B.asdafaa267
C.asd
D.z67
第1题:
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #inelude <string.h> int fun(char *str) { int i,j=0; for(i=0;str[i]!='\0';i++) if(str[i]!='')str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; printf("Input a string:"); gets(str); puts(str); fun(str); printf("%s\n",str); }
A.asdafaaz67
B.asd af aa z67
C.asd
D.z67
第2题:
阅读下列程序,当运行程序时,输入asd af aa z67,则输出为( )。 #include <sldio.h> int fun (char *str) { int i,j=0; for(i=0;str[i]! ='\0';i++) if(str[i]! =") str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; printf("Input a string:"); gets(str); fun(str); printf("%s\n",str); }
A.asdafaaz67
B.asd af aa z67
C.asd
D.z67
第3题:
有以下程序,当输入数据为:12.5时,程序输出结果是()。 #include "stdio.h" main() { int a; scanf("%d",&a); printf("a=%dn",a); }
第4题:
请补充main函数,该函数的功能是:从键盘输入若干字符放到一个字符数组中,当桉回车键时结束输入,最后输出这个字符数组中的所有字符。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
include<stdio.h>
include<ctype.h>
main()
{
int i=0;
char a [81];
char *p=s;
clrscr ();
printf{" Input a string \n");
for (i=0; i<80; i++)
{
s [i] =getchar ( );
if (s [i]=='\n')
【 】;
}
s[i]=【 】
printf(" display the string \n");
while (*p)
putchar (【 】);
}
第5题:
C语言本身有提供输入输出语句,但是要使用标准的I/O库函数(即输入/输出库函数),须在程序头加入#include “stdio.h”。()