2012大连理工大学C语言机房模拟试题之程序填空题(全).doc
文本预览下载声明
程序填空
/*-------------------------------------------------------
【程序填空】
---------------------------------------------------------
功能:计算平均成绩并统计90分以上人数。
-------------------------------------------------------*/
#include stdio.h
main()
{
int n,m;float grade,average;
/***********FILL***********/
average=n=m=_____; //0
while(1)
{
/***********FILL***********/
_____(%f,grade); //scanf
if(grade0) break;
n++;
average+=grade;
/***********FILL***********/
if(grade90)_____; //continue
m++;
}
if(n) printf(%.2f%d\n,average/n,m);
}
/*-------------------------------------------------------
【程序填空】
---------------------------------------------------------
功能:求出二维数组中的最大元素值。
-------------------------------------------------------*/
#include stdio.h
/***********FILL***********/
int max_value(int m,int n,int ______) // array[][4] array[3][4]
{
int i,j,max;
max=array[0][0];
for(i=0;im;i++)
for(j=0;jn;j++)
/***********FILL***********/
if(maxarray[i][j])_____; // max=array[i][j]
return(max);
}
main()
{
int a[3][4]={{1,3,5,7},{2,4,6,8},{15,17,34,12}};
/***********FILL***********/
printf(max value is %d\n,_____); //max_value(3,4,a)
}
/*-------------------------------------------------------
【程序填空】1324
---------------------------------------------------------
题目:本程序的功能是输入一段数字后,将输出的数字颠倒输出。
请填空。
-------------------------------------------------------*/
#include stdio.h
main()
{
int numb,rdigit;
scanf(%d,numb);
/***********FILL***********/
while(_____) // numb!=0 numb
{
rdigit=numb%10;
/***********FILL***********/
printf(%d,_____); // rdigit
numb/=10;
}
printf(\n);
}
/*-------------------------------------------------------
【程序填空】1573
---------------------------------------------------------
题目:本程序用printf函数输出字符串I am student,完善程序。
-------------------------------------------------------*/
#include stdio.h
main()
{
int i;
char *s1=I am student;
/**********
显示全部