单选题设有下列说明语句: strcut str int x;float y;char z;st; 则下列的叙述中不正确的是( )。
单选题有以下程序:
#include
void fun(int *s)
{
static int j=0;
do s[j]+=s[j+1];
while(++j<2);
}
main()
{
int i,a[10]={1,2,3,4,5};
for(i=1;i<3;i++)
fun(a);
for(i=1;i<5;i++)
printf("%d",a[i]);
printf("\n");
}
程序运行后的输出结果是( )。
单选题下列关于栈的叙述正确的是______。
单选题设变量x和变量y都是int类型,且x=l,y=2, 则printf(''%d%d'',x,y,(x,y))的输出结果是 ( )。
单选题G)w,one
单选题有以下程序
#include
main()
{ int a=1,b=0;
if(- -a) b++;
else if(a==0) b+=2;
else b+=3;
printf("%d\n",b);
}
程序运行后的输出结果是
单选题下面四个选项中,均是合法整型常量的选项是
单选题有以下程序
#include
void main()
{int s;
scanf("%d",&s);
while(s>0)
{switch(s) {
case 1:printf("%d",s+5);
case 2:printf("%d",s+4);break;
case 3:printf("%d",s+3);
default:printf("%d",s+1);break;
}
scanf("%d",&s);}}
运行时,若输入1 2 3 4 5 0,则输出结果是
单选题有如下程序: #define n 2 #define m N+1 #define NUM 2*m+1 main() int i; for(i=1;i<=NUM;i++)printf("%d/n",i); 该程序中的for循环执行的次数是______。A) 5 B) 6 C) 7 D) 8
单选题设有以下语句:
typedef struct S
{ int g; char h; } T;
则下面叙述中正确的是( )。
单选题若执行下列程序时从键盘上输入2,则输出结果是( )。 #include<stdio.h> main() int a; scanf("%d",&
单选题以下程序运行后,输出结果是______。 main() {char ch[2][5]={"693","825"},*p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>='0'j+=2) s=10*s+p[i][j]-'0'; printf("%d/n",s); }
单选题有以下程序段: int *p; p=______malloc(sizeof(int)); 若要求使p指向一个int型的动态存储单元,在横线处应填入的是( )。
单选题有以下程序:
# include <stdio.h>
int f(int x);
main()
{int n=1,m;
m=f(f(f(n)));printf("%d/n",m);
}
int f(int x)
{ return x*2;}
程序运行后的输出结果是______。
单选题下列运算符中优先级最低的算符是______。
单选题有以下程序:
#included<stdio.h>
main()
{char s[]={"012xy"}; int i, n=0;
for(i=0; s[i]!=0; i++)
if(s[i]>="a"
printf("%d/n", n);
}
程序运行后的输出结果是______。
单选题设某棵树的度为3,其中度为3、2、1的结点个数分别为3、0、4。则该树中的叶子结点数为
单选题有以下程序
#include<stdio.h>
main()
{
int a=2, c=5;
printf("a=%%d, b=%%d/n", a, c);
}
程序的输出结果是______。
单选题设有定义:struct STR{int real,unreal;)datal={1,8},data2;则以下赋值语句中错误的是( )。
单选题以下程序中函数scmp的功能是返回形参指针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对字符串进行复制*/
strcpy(string,scmp(string,str[2]));
printf("%s/n",string);
}
若运行时依次输入:abcd、abba和abc三个字符串,则输出结果为( )。