全部知识点

第1141题

以下程序的运行结果是()。

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);
 }


第1142题

请阅读以下程序;

#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);
 }

输出结果为:

第1143题
#include<stdio.h>
main()
{
	int a[]={1,2,3,4},y,*p=&a[3];
	--p;y=*p;
	printf("y=%d\n",y);
 }

运行结果为:

第1144题

下面的for语句的循环次数为()。

for(x=1,y=0;(y!=19)&&(x<6);x++);

第1145题
#include<stdio.h>
main()
{
	int a=0,b=1,c=2;
	if(++a>0||++b>0)
	++c;
	printf("%d,%d,%d",a,b,c);
 }

输出结果:

第1146题
#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");
 }

从第一列开始输入数据(代表一个回车符):3845,则程序输出结果为()。

第1147题

C语言规定,函数返回值的类型是()。

第1148题

执行下列程序时输入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);
 }


第1149题


fun(int *b,int c,int d)
{
	int k;
	for(k=0;k<c*d;k++)
	{
		*b=c+d;
		b++;
	}
}

则调用此函数的正确写法是(假设变量a的说明为int a[10])( )。

第1150题

设Y为整型变量,A=1,A的地址为EF01;B=2,B的地址为EF02;执行语句B=&A;Y=&b;后Y的值()。

第1151题
#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);
 }

程序运行后的输出结果是()。

第1152题

以下语句定义正确的是()。

第1153题

下列一维数组说明中,不正确的是()。

第1154题

下面函数的功能是()。

sss(s,t)
char *s,*t;
{
	while((*s)&&(*t)&&(*t++==*s++));
	return (*s-*t);
}


第1155题
#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]);
 }

程序运行结果:

第1156题

若已定义:int a[]={0,1,2,3,4,5,6,7,8,9},*p=a,i;  其中0<=i<=9,则对a数组元素不正确的引用是()。

第1157题

C语言中,凡未指定存储类别的局部变量的隐含存储类别是()。

第1158题

以下叙述中不正确的是()。

第1159题
#include<stdio.h>
#define F(x) 2.84+x
#define w(y) printf("%d",(int)(y))
#define P(y) w(y)
main()
{
	int x=2;
	P(F(5)*x);
}

输出结果:

第1160题

设有下面的定义:

struct st
{
	int a;
	float b;
}d;
int *p;

要使指向结构变量a中的a成员,正确的赋值语句是()。