题目
A.6
B.10
C.11
D.15
第1题
设文件test.txt中原已写入字符串Begin,执行以下程序后,文件中的内容为【 15 】 。
#include <stdio.h>
main()
{ FILE *fp;
fp= fopen("test.txt”, ”w+”);
fputs("test",fp);
fclose(fp);
}
第2题
以下程序中函数setup的功能是返回形参指针s1和s2所指字符串中较小字符串的首地址: # include<stdio. h> # include<string. h> char * scmp(char * s1, char * s2) { if(strcmp(s1, s2)<0) return(s1); else return(s2); } main() { int i; char string[20], str[3][20]; for(i=0; i<3; i++)gets(str[i]); strcpy(string, scmp(str[0], str[1])); strcpy(string, scmp(string, str[2])); printf("% s\n", string); } 若运行时依次输入:abcd、abba和abc3个字符串,则输出结果为______。
A.abcd
B.abba
C.abc
D.abca
第3题
有以下程序:
# include< iostream>
执行这个程序,输出结果是()。
第8题
有以下程序
#include <stdio.h>
#include <string.h>
main()
{ printf("%d\n",strlen ("ATS\n012\1") ); }
程序运行后的输出结果是
A)3
B)8
C)4
D)9
第9题
有以下程序: #include <iostream> #include <fstream> using namespace std; int main () { ofstream ofile; char ch; ofile.open ("abc.txt"); cin>>ch; while (ch!='#' ) { cin>>ch; ofile.put(ch);
A.程序编译时出错
B.abc#
C.abc
D.#
第10题
有以下程序:
include<stdio.h>
include<strin9.h>
main()
{printf{"%d\n",strlen("%d\n",strlen("ATS\n012\|"));}
程序运行后的输出结果是()。
A.3
B.8
C.4
D.9
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!