1.*#*#*2.1,23.ACE4.1 1 2 3 5
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-5d50-c003-bc7499099f01.html
点击查看答案
1.下面关于continue和break语句的叙述中正确的是( )。
A. continue和break语句都可以出现在switch语句中
B. continue和break语句都可以出现在循环语句的循环体中
C. 在循环语句和switch语句之外允许出现continue和break语句
D. 执行循环语句中的continue和break语句都将立即终止循环
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-8678-c003-bc7499099f01.html
点击查看答案
1.假设10个整数存储在数组a[10]中,要求把其中能被12整除的数标记为T,其他标记为F。标记存储在字符数组b[10]中下标相同的对应位置。试编写程序,实现以上功能,并输出两个数组。
#include
int main()
{ int i,a[]={11,12,23,36,48,56,72,78,89,96};
char b[10];
for(i=0;i<10;i++)
{ printf( );
if(a[i]%12==0)b[i]='T';
else b[i]='F';
}
printf( );
for(i=0;i<10;i++)
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-bac8-c003-bc7499099f00.html
点击查看答案
2.下面关于循环语句for、while、do_while的叙述中正确的是( )。
A. 三种循环语句都可能出现无穷循环
B. 三种循环语句中都可以缺省循环终止条件表达式
C. 三种循环语句的循环体都至少被无条件地执行一次
D. 三种循环语句的循环体都必须放入一对花括号中
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-8a60-c003-bc7499099f00.html
点击查看答案
45.已知函数f的定义如下:
void f( )
{ int i;
for(i=0; i<y; i++)
x[i]+=y;
}
若main()函数中有声明“int a[10]={10};”及调用函数f的语句,则调用函数f的正确形式是( )。
A. f(a[],a[0]);
B. f(a[0],a[0]);
C. f(&a[0],a[0]);
D. f(a[0],&a[0]);
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-5708-c003-bc7499099f00.html
点击查看答案
10. 若有定义“long a, b”且变量a和b都需要通过键盘输入获得初值,则下列语句中正确的是( )。
A. scanf("%ld%ld,&a,&b");
B. scanf("%d%d",a,b);
C. scanf("%d%d",&a,&b);
D. scanf("%ld%ld",&a,&b);
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-2300-c003-bc7499099f00.html
点击查看答案
58.下面程序段在编译时不会报错的是( )。
A. #define double 2
B. #define b 2
void main()void main()
{double b=0;}{int b=0;}
C. #define b 2
D. #define b 2
void main()int x=b;
{b++;}void main()
{x++;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-c928-c003-bc7499099f00.html
点击查看答案
11.B12.A13.B14.C15.C16.A17.D18.C19.C20.B
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-23f8-c003-bc7499099f00.html
点击查看答案
35. 下面函数定义中正确的是( )。
A. int fun(int a, b){ }
B. int fun(int a[][]){}
C. int fun(void){}
D. int fun(static int a, int b){}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-2ff8-c003-bc7499099f00.html
点击查看答案
7.变量的值在函数调用结束后仍然保留,以便下一次调用该函数时使用,可以将局部变量定义为( )类型。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-da08-c003-bc7499099f04.html
点击查看答案