以下程序段输出结果是()。
main()
{ int k,j,s;
for(k=2;k<6;k++,k++)
{ s=1;for(j=k;j<6;j++) s+=j;}
printf(“%d\n”,s);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346522.html
点击查看答案
有以下程序
#include
fun(int n, int *s)
{ int f1, f2;
if(n==1||n==2)
*s=1;
else
{ fun(n-1, &f1);
fun(n-2, &f2);
*s=f1+f2;
}
}
void main()
{ int x;
fun(6, &x);
printf("%d\n", x);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346519.html
点击查看答案
下列变量定义中合法的是()。
A. short _a=1-.le-1;
B. double b=1+5e2.5;
C. long do=0xfdaL;
D. float 2_and=1-e-3;
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346511.html
点击查看答案
若二维数组a有m行n列,则下面能够正确引用元素a[i][j]的为() 。
A. *(a+j*n+i)
B. *(a+i*n+j)
C. *(*(a+i)+j)
D. *(*a+i)+j
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346518.html
点击查看答案
表达式“0?(0?3:2):(10?1:0)”的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650a.html
点击查看答案
有以下程序
main()
{char s[ ]={ "aeiou"},*ps;
ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是()。
A. a
B. e
C. u
D. 元素s[4]的地址
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346503.html
点击查看答案
有以下程序
#include
#include
void fun(char *w,int m)
{char s,*p1,*p2;
p1=w;p2=w+m-1;
while(p1}
main()
{char a[]=”123456”;
fun(a,strlen(a)); puts(a);
}
程序运行后的输出结果是( )。
A. 654321
B. 116611
C. 161616
D. 123456
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346514.html
点击查看答案
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char s1[50]={"some string *"},s2[]={"test"};
printf("%s\n", strcat(s1,s2));
}
执行后的输出结果是( )。
A. some string
B. test
C. some stritest
D. some string *test
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346511.html
点击查看答案
有以下程序
#include
void main()
{
int j,a[]={1,3,5,7,9,11,13,15},*p=a+5;
for(j=3;j;j--)
{
switch(j)
{
case 1:
case 2:printf("%d",*p++);
case 3:printf("%d",*(--p));
}
}
}
执行后的输出结果是( )。
A. 9911
B. 79911
C. 99999
D. 991113
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346522.html
点击查看答案
有以下程序
#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
点击查看答案