相关题目
有以下程序
#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<回车>,则输出结果为( )。
下程序运行后的输出结果是() 。
#include
main()
{ int a;
a=(int)((double)(3/2)+0.5+(int)1.99*2);
printf("%d\n",a);
}
有以下程序
#include
main()
{ unsigned char a=8,c;
c=a>>3;
printf("%d\n",c);
}
程序运行后的输出结果是()。
有以下程序
#include
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是()。
有以下程序
#include
struct ord
{ int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x)); printf("%d\n",++(p->y));
}
程序运行后的输出结果是()。
有以下程序
#include
#define S(x) 4*(x)*x+1
main()
{ int k=5,j=2;
printf("%d\n",S(k+j));
}
程序运行后的输出结果是()。
有以下程序
#include
int fun()
{ static int x=1;
x*=2;
return x;
}
main()
{ int i,s=1;
for(i=1;i<=3;i++) s*=fun();
printf("%d\n",s);
}
程序运行后的输出结果是()。
有以下程序
#include
int fun (int x,int y)
{ if (x!=y) return ((x+y)/2);
else return (x);
}
main()
{ int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是 ()。
设有如下函数定义
int fun(int k)
{ if (k<1) return 0;
else if(k==1) return 1;
else return fun(k-1)+1;
}
若执行调用语句:n=fun(3);,则函数fun总共被调用的次数是( )。
有以下程序
#include
main()
{ char a[30],b[30];
scanf("%s",a);
gets(b);
printf("%s\n %s\n",a,b);
}
程序运行时若输入:
how are you? I am fine<回车>
则输出结果是()。
