有以下程序
#include
main()
{char ch[3][5]={“AAAA”,”BBB”,”CC”};
printf(“%s\n”,ch[1]);
}
程序运行后的输出结果是()。
A. AAAA
B. CC
C. BBBCC
D. BBB
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346513.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ char s[12]= "a book";
printf("%.4s",s);
}
执行后的输出结果是( )。
A. a book!
B. a book![四个空格]
C. a bo
D. 格式描述错误,输出不确定
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650b.html
点击查看答案
有以下程序
#include
main()
{ int x=011;
printf("%d\n",++x);
}
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651a.html
点击查看答案
下面程序的输出结果是()。
#include
#include
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650a.html
点击查看答案
有以下程序
main()
{ int i,s=1;
for (i=1;i<50;i++)
if(!(i%5)&&!(i%3)) s+=i;
printf("%d\n",s);}
程序的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651d.html
点击查看答案
有以下程序
#include
main()
{ int x;
scanf("%d",&x);
if(x>15) printf("%d",x-5);
if(x>10) printf("%d",x);
if(x>5) printf("%d\n",x+5);
}
若程序运行时从键盘输入12<回车>,则输出结果为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346506.html
点击查看答案
有以下程序
#include "stdio.h"
void main( )
{ int n[3][3], i, j;
for(i=0;i<3;i++ )
for(j=0;j<3;j++ )
n[i][j]=i+j;
for(i=0;i<2;i++ )
for(j=0;j<2;j++ )
n[i+1][j+1]+=n[i][j];
printf("%d\n", n[i][j]);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346505.html
点击查看答案
下面的程序执行后,文件test中的内容是 ()。
void fun(char *fname,char *st)
{ FILE *myf; int i;
myf=fopen(fname,"w" );
for(i=0;st[i];i++)
fputc(st[i],myf);
fputc('\0',myf);
fclose(myf);
}
main()
{ fun("test","new world"); fun("test","hello,");}
A. hello,
B. new worldhello,
C. new world
D. hello, rld
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650e.html
点击查看答案
有以下程序
fun(int x,int y)
{static int m=0,i=2; i+=m+1;m=i+x+y; return m; }
main()
{int j=1,m=1,k;
k=fun(j,m); printf("%d,",k);
k=fun(j,m);
printf("%d\n",k);
}
执行后的输出结果
A. 5,5
B. 5,11
C. 11,11
D. 11,5
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651d.html
点击查看答案
在宏定义#define PI 3.14159中,用宏名PI代替一个()。
A. 常量
B. 单精度数
C. 双精度数
D. 字符串
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650e.html
点击查看答案