注意:此页面搜索的是所有试题
兰州理工大学C语言程序设计a
下列定义正确的是( ) A.enum t={a,b}x; B. enum t{1,2}x; C. enum {′+′,′-′}x; D. enum t{a,b}x;
设有定义:struct u{int a[4];float b[3]; char c[16];}aa; 则 printf(″%d\n″,sizeof(aa));的输出是( ) A.32 B.36 C.12 D.8
数据-54.78 在文本文件中占用的字节个数是( ) A.4 B.5 C.6 D.8
在宏定义#define p(r) 3.14*r 中,请问宏名是( ) A. p B. p(r) C. 3.14*r D. p(r) 3.14*r
要打开一个已存在的用于修改的非空二进制文件“hello.txt”,正确语句是( ) A. fp=fopen( "hello.txt ","r" ) B. fp=fopen( "hello.txt ","ab+" ) C. fp=fopen( "hello.txt ","w" ) D. fp=fopen( "hello.txt ","r+" )
以下程序的功能是:从键盘上输入若干个学生的成绩, 统计并输出最高成绩和最低成 绩,当输入负数时结束输入.请填空.#include <stdio.h> int main(int argc, char* argv[]) { float x,amax,amin; scanf("%f",&x); amax=x; amin=x; while( 21 ) { if(x>amax) amax=x; if( 22 ) amin=x; scanf("%f",&x); }printf("\namax=%f\namin=%f\n",amax,amin); return 0; }
下面程序的功能是比较字符数组 a 和字符数组 b 中的两个字符串是否相等(比较对应 字符,全部相同输出 0,如果不同,返回第一个不相同的字符差值,并输出)。#include <stdio.h> int main(void) { char a[100]="Hello World!"; char b[100]="Hello Chengdu!"; 23 ; /* 完成对应字符的比较,并判定一个字符串是否 结束了*/ while( 24 ) { i++; }printf("%d\n", a[i]-b[i] ); return 0;
就以下程序空缺的地方进行填空。#include <stdio.h> #include <ctype.h> int main(int argc, char* argv[]) { char str[81],*sptr; int i; for(i=0;i<80;i++) { str[i]=getchar(); if(str[i]==.\n.) break; }str[i]= ( 25 ); sptr=str; while(*sptr) putchar( 26 ); return 0; }
.以下程序对一个 3×3 的矩阵进行行列互换#include <stdio.h> int main(int argc, char* argv[]) { int i,j,temp; int a[3][3]={1,2,3,4,5,6,7,8,9}; for( i=0 ; i<3; i++) for( j=0; ( 27 )i; j++) temp=a[i][j], ( 28 ), ( 29 ); printf("\n the result array is:\n"); for(i=0;i<3;i++) { printf("\n"); for(j=0;j<3;j++) printf("%5d",a[i][j]); }return 0; }
设计函数实现将一个字符串中小写字母转化为大写字母。
计算 e  1 11!  21! n1! 的值并输出(设 n=20)