全部知识点
第1141题
下列叙述中错误的是()。
第1142题
若有定义:int a=7,float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是
第1143题
若下列选项中的各变量均为整型且已有值,其中不正确的赋值语句是
第1144题
下列关于逻辑运算符两侧运算对象的叙述中正确的是()。
第1145题
若有说明int a[3][4];则数组元素的非法引用是()。
第1146题
以下程序的运行结果是()。
main()
{
int a=-5,b=1,c=1;
int x=0,y=2,z=0;
if(c>0)
x=x+y;
if(a<=0)
{
if(b>0)
if(c<=0)
y=x-y;
}
else if(c>0)
y=x-y;
else z=y;
printf("%d,%d,%d\n",x,y,z);
}
第1147题
请阅读以下程序;
#include<stdio.h>
main()
{
int x=1,y=0,a=0,b=0;
switch(x)
{
case 1:
switch(y)
{
case 0:a++;break;
case 1:b++;break;
}
case 2:
a++;b++;break;
}
printf("a=%d,b=%d\n",a,b);
}输出结果为:
第1148题
#include<stdio.h>
main()
{
int a[]={1,2,3,4},y,*p=&a[3];
--p;y=*p;
printf("y=%d\n",y);
}运行结果为:
第1149题
下面的for语句的循环次数为()。
for(x=1,y=0;(y!=19)&&(x<6);x++);
第1150题
#include<stdio.h>
main()
{
int a=0,b=1,c=2;
if(++a>0||++b>0)
++c;
printf("%d,%d,%d",a,b,c);
}输出结果:
第1151题
#include<stdio.h>
main()
{
int c;
while(c=getchar()!='\n')
{
switch(c-'3')
{
case 0:
case 1:putchar(c+4);
case 2:putchar(c+4);break;
case 3:putchar(c+3);
case 4:putchar(c+3);break;
}
}
printf("\n");
}从第一列开始输入数据(
第1152题
C语言规定,函数返回值的类型是()。
第1153题
执行下列程序时输入456<空格>789<空格>123<回车>,输出结果是
#include<stdio.h>
main()
{
char m[80];
int c,i;
scanf("%c",&c);
scanf("%d",&i);
scanf("%s",&m);
printf("%c,%d,%s\n",c,i,m);
}
第1154题
fun(int *b,int c,int d)
{
int k;
for(k=0;k<c*d;k++)
{
*b=c+d;
b++;
}
}则调用此函数的正确写法是(假设变量a的说明为int a[10])( )。
第1155题
设Y为整型变量,A=1,A的地址为EF01;B=2,B的地址为EF02;执行语句B=&A;Y=&b;后Y的值()。
第1156题
#include<stdio.h>
main()
{
int aa[5][5]={{5,6,1,8},{1,2,3,4},{1,2,5,6},{5,9,10,2}};
int i,s=0;
for(i=0;i<4;i++)
s+=aa[i][2];
printf("%d",s);
}程序运行后的输出结果是()。
第1157题
以下语句定义正确的是()。
第1158题
下列一维数组说明中,不正确的是()。
第1159题
下面函数的功能是()。
sss(s,t)
char *s,*t;
{
while((*s)&&(*t)&&(*t++==*s++));
return (*s-*t);
}
第1160题
#include<stdio.h>
#include"string.h"
void fun(char *s[],int n)
{
char *t;int i,j;
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(strlen(s[i])>strlen(s[j]))
{
t=s[i];s[i]=s[j];s[j]=t;
}
}
main()
{
char *ss[]={"bcc","bbcc","xy","aaaacc","aabcc"};
fun(ss,5);
printf("%s,%s\n",ss[0],ss[4]);
}程序运行结果: