高校题库

第781题

当a=1,b=2,c=3时,执行以下程序段后c=_____。

if(a>c)
    b=a;
a=c;
c=b;
第782题

已知i=5,写出语句a=(i>5)?0:1;执行后整型变量a的值是_____。

第783题

若输入字符串:abcde<回车>,则以下while循环体将执行_____次。

while((ch=getchar())=='e')
    printf("*");
第784题

执行语句char str[81]="abcdef";后,字符串str结束标志存储在str[_____](在括号内填写下标值)中。

第785题

定义int a[2][3];表示数组a中的元素个数是_____个。

第786题

如果函数不要求返回值,可用_____来定义函数为空类型。

第787题

预处理命令行都必须以_____号开始。

第788题

将数组a的首地址赋给指针变量p的语句是_____。

第789题

设有以下共用体类型说明和变量定义,则变量c在内存所占字节数是_____。

union stud
{
    short int num;
    char name[10];
    float score[5];
    double ave;
}
c;
第790题

功能:编写函数fun(int m)求1000以内(不包括1000)所有m的倍数之和。

#define N 1000
#include<stdio.h>
int fun(int m)
{
    int s=0,i;
    for(_____1_____)
        if(_____2_____)
            _____3_____
    _____4_____
}
void TestFunc()
{
    FILE *OUT;
    int o;
    OUT=fopen("out.dat","w");
    if(OUT==NULL)
    {
        printf("Write File Error");
    }
    o = fun(6);
    fprintf(OUT,"%d\n",o);
    fclose(OUT);
}
void main()
{
    int sum;
    sum=fun(7);
    printf("%d以内所有%d的倍数之和为:%d\n",N,7,sum);
   TestFunc();
}
第791题

功能:从低位开始取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。

例如:当s中的数为:7654321时,t中的数为:642。

#include<stdio.h>
long fun(long s,long t)
{
    long sl=10;
    _____1_____
    _____2_____
    while(_____3_____)
    {
        _____4_____
        _____5_____
        _____6_____
    }
    return t;
}
void main()
{
    long s, t,m;
    void TestFunc();
    printf("\nPlease enter s:");
    scanf("%ld", &s);
    m=fun(s,t);
    printf("The result is: %ld\n", m);
    TestFunc();
}
void TestFunc()
{
    FILE *IN,*OUT;
    int n;
    long i,t,m;
    IN=fopen("in.dat","r");
    if(IN==NULL)
    {
        printf("Read File Error");
    }
    OUT=fopen("out.dat","w");
    if(OUT==NULL)
    {
        printf("Write File Error");
    }
    for(n=0;n<5;n++)
    {
        fscanf(IN,"%ld",&i);
        m=fun(i,t);
        fprintf(OUT,"%ld\n",m);
     }
    fclose(IN);
    fclose(OUT);
}
第792题

一个C源程序中至少应包括一个_____函数。

第793题

若有定义:

int a=10,b=9,c=8;

接着顺序执行下列语句后,变量c中的值是_____。

c=(a-=(b-5));
c=(a%11)+(b=3);
第794题

若a是int型变量,则计算表达式a=25/3%3后a的值为_____。

第795题

设(k=a=5,b=3,a*b),则k值为_____。

第796题

在C语言中,格式输入操作是由库函数(只写函数名)_____完成的,格式输出操作是由库函数(只写函数名)_____完成的。

第797题

x=5,y=8时,C语言表达式5-2>=x-1<=y-2的值是_____。

第798题

当a=3,b=2,c=1时,执行以下程序段后b=_____。

if(a>b)
    a=b;
if(b>c)
    b=c;
else c=b;
c=a;
第799题

设x=(5>1)+2,x的值为_____。

第800题

程序段:

int k=10;
while(k=0)
    k=k-1;

循环体语句执行_____次。