执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。
main()
{ char s[100]; int c, i;
scanf("%c",&c); scanf("%d",&i); scanf("%s",s);
printf("%c,%d,%s\n",c,i,s);
}
A. 123456789
B. 1456789
C. 1,23,456,789
D. 1,23,456
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346522.html
点击查看答案
以下函数的功能是:通过键盘输入数据,为数组中的所有元素赋值。
#include
#define N 10
void fun(int x[N])
{ int i=0;
while (i scanf("%d",______);
}
在程序中下划线处应填入的是( )。
A. x+i
B. &x[i+1]
C. x+(i++)
D. &x[++i]
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346520.html
点击查看答案
以下数组定义中不正确的是()。
A. int a[2][3];
B. int b[][3]={0,1,2,3};
C. int c[100][100]={0};
D. int d[3][]={{1,2},{1,2,3},{1,2,3,4}};
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650c.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
点击查看答案
以下程序运行后的输出结果是( )。
#include
main()
{ int i,n[5]={0};
for(i=1;i<=4;i++)
{ n[i]=n[i-1]*2+1; printf("%d",n[i]); }
printf("\n");
}
A. 13715
B. 13716
C. 13717
D. 13714
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346509.html
点击查看答案
有以下程序
#include
int w=3;
void main()
{ int w=10;
printf("%d\n",fun(5)*w);
}
fun(int k)
{ if(k==0) return(w);
return(fun(k-1)*k);
}
执行后的输出结果是( )。
A. 360
B. 3600
C. 1080
D. 2100
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651a.html
点击查看答案
执行以下语句:x+=y;y=x-y;x-=y;的功能是()。
A. 把x和y按从大到小排列
B. 把x和y按从小到大排列
C. 无确定结果
D. 交换x和y中的值
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651c.html
点击查看答案
以下叙述中错误的是()。
A. 可以通过typedef增加新的类型
B. 可以用typedef将已存在的类型用一个新的名字来代表
C. 用typedef定义新的类型名后,原有类型名仍有效
D. 用typedef可以为各种类型起别名,但不能为变量起别名
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346506.html
点击查看答案
在C语言中,要求运算数必须是整数的运算符是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346502.html
点击查看答案
下面的C程序完成的功能是()。
#define SIZE 5
void func(int data[SIZE]);
main()
{
int i,buf[SIZE];
printf("Please input %d numbers:",SIZE);
for(i=0;i scanf("%d",&buf[i]);
func(buf);
for(i=0;i printf("%5d",buf[i]);
}
void func(int data[SIZE])
{
int i,j,d;
for(i=0;i for(j=0;j if(data[j]>data[j+1])
{
d=data[j];
data[j]=data[j+1];
data[j+1]=d; }
}
A. 对一维数组降序排序
B. 对一维数组升序排序
C. 对一维数组逆向排序
D. 对一维数组顺序排序
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650b.html
点击查看答案