更多"请补充main( )函数,该函数的功能是:计算每个学生成绩的平均分,并"的相关试题:
[填空题]请补充main( )函数,该函数的功能是:计算每个学生成绩的平均分,并把结果保存在数组aver中。
例如,当score[N][M]=(83.5,82,86,65,67,80,91.5,84,99,95,90.5,95,86,95,97时,3个学生的平均分为76.7 89.9 92.7。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在main( )函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define N 3
#define M 5
void main( )
int i,j;
static float score[N][M]=(83.5,82,86,65,67),80,91.5,84,99,95,90.5,95,86,95,97;
float aver[N];
system("CLS");
for(i=0;i<N;i++)
(1) ;
for(i=0;i<N;i++)
for(j=0;j<M;j++)
(2) ;
aver[i]/=M;
for(i=0;i<N;i++)
printf("/nstudent%dktaverage=%5.1f",i+1,aver[i]);
[填空题]请补充main函数,该函数的功能是:计算每个学生成绩的平均分,并把结果保存在数组bb中。
例如,当scorer[N][M]=83.5,82,86,65,67),80,91.5,84, 99,95)90.5,95,86,95,97时,三个学生的平均分为76.7 89.9 92.7。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若千表达式或语句。
试题程序:
#include<stdio.h>
#define N 3
#define M 5
main( )
int i,j;
static float score[N][M]=83.5,82,86,
65,67,80,91.5,84,99,95,90.5,95,
86,95,97;
float bb[N];
clrscr( );
for(i=0;i<N;i++)
【1】;
for(i=0;i<N;i++)
for (j=0; j<M; j++)
【2】;
bb [i]/=M;
for (i=0; i<N; i++)
print f (" knstudent %d/t average
=%5.1f",i+l,bb[i]);
[简答题]请编写函数fun( ),该函数的功能是:计算n门课程的平均分,计算结果作为函数值返回。
例如x有5门课程的成绩是90.5,72,80,61.5,55,则函数的值为71.80。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
#include <stdio.h>
float fun (float *a, int n)
main ( )
float score[30]=(90.5,72,80,61.5,55,
aver;
aver=fun(score, 5);
printf("/nAverage score is: %5.2f
/n",aver);
[填空题]请补充main函数,该函数的功能是:计算三名学生学科的平均成绩。
例如,当score[N][M]={{83.5,82,86,65,67},{80,91.5,84, 99,95},{90,95,86,95,97}时,五门学科的平均分为:84.5 89.5 85.3 86.3 86.3。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
# include<stdio, h>
#define N 3
#define M 5
main ( )
{
int i,j;
static float score [N] [M]= { {83.5, 82,86,
65,67}, {80,91.5,84,99,95},
{90, 95, 86, 95, 97} };
static float bb[N];
clrscr ( );
for ( i=0; i<M; i++)
bb[i]=0.0;
for(i=0;i< 【1】 ;i++)
{
for(j=0;j< 【2】 ;j++)
bb [j]+=score [i] [j];
}
for (i=0; i<M; i++)
print f (" /nsubject%d/taverage=%5.1 f",
i+1, 【3】 );
return 0;
}
[填空题]请补充main 函数,该函数的功能是:计算两个自然数n和m(m<10000)之间所有数的和(n和m从键盘输入)。
例如:当n=1,m=100时,sum=5050:当n=100,m=1000时,sum=495550。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在 main 函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<conio.h>
main ( )
int n, m;
long sum;
【1】
clrscr ( );
printf ("/nInput n,m/n");
scanf ("%d, %d", &n, &m);
while (n<=m)
【2】
n++;
printf ("sum=% 【3】 /n", sum);
[填空题]请补充main函数,该函数的功能是:从键盘输入只有两个整数参与运算的一个四则运算式,然后计算出它的值。注意数字全部为正整数。
例如,输入308*28,结果为8624.000000。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
# include<stdio, h>
main ( )
int a=0, b=0, flag=l, fg=l;
float result;
char *p, ch;
char str[10];
clrscr ( );
printf("/n Input a string /n");
gets (str);
p=str;
while (*p)
if (*p>=’0’ &&*p<=’9’ && flag==l )
a= 【1】 ;
else
if (fg)
ch=*p;
flag=2;
fg=0;
if (*p>=’0 ’ &&*p<=’9’ &&flag==2)
b= 【2】 ;
p++;
switch( 【3】 )
case ’+’: result=a+b;break;
case ’-’: result=a-b;break;
case ’*’ :result=a*b;break;
case ’/’ :result= (float) a/b;break;
printf ("/nresult=%f", re
[填空题]请补充fun函数,fun函数的功能是求n的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句
试题程序:
#include<stdio.h>
long fun(int n)
if( (1) )
return(n*fun( (2) ));
return (3) ;
main( )
printf("10!=%1d/n",fun(10));
[填空题]请补充fun( )函数,该函数的功能是求m的阶乘。不要改动主函数main( )与他函数中的任何内容,仅在fun( )函数的横线上填写所需的若干表达式或语句。
注意:部分源程序如下。
#include<stdio.h>
long fun(int m)
if (1)
return(m*fun (2) );
return (3) ;
main( )
printf("8!=%ld/n",fun(8));
[简答题]Excel操作题
(1)计算每个学生的平均分,不保留小数。
(2)分别合并“最高分”与“最低分”所在的前两列单元。
(3)分别计算三门课程的最高分及平均分中的最高分。
(4)分别计算三门课程的最低分及平均分中的最低分。
(5)第一行标题跨列居中,标题用红色20磅楷体。
会计08-10班 学生成绩表 |
学号 | 姓名 | 会计学 | 统计学 | 财务管理 | 评均分 |
[填空题]请补充fun函数,该函数的功能是:判断一个年份是否为闰年。 例如,1900年不是闰年,2004是闰年。 [注意] 部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。 [试题源程序] #include<stdio.h> #include<conio.h> int fun(int n) int fiag=0; if(n%4==0) if( (1) ) fiag=1; if( (2) )flag=1; return (3) ; void main( ) int year; clrscr( ); printf("Input the year:"); scanf("%d", &year); if(fun(year)) printf("%d is a leap year./n", year); else printf("%d is not a leap year./n", year);
购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
请选择支付方式
-
微信支付
-
支付宝支付
立即支付
系统将自动为您注册账号
请使用微信扫码支付
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码
|
|