可以帮我写出这个C语言程序来吗 Write a complete program that prompts how many students?reads the number.Make a loop for that many students,prompts the first student for name and how many tests,get name,number of tests.Make a loop to sum
来源:学生作业学帮网 编辑:学帮网 时间:2024/05/16 19:56:23
可以帮我写出这个C语言程序来吗
Write a complete program that prompts how many students?reads the number.
Make a loop for that many students,prompts the first student for name and how many tests,get name,number of tests.Make a loop to sum all of her/his tests and compute the average of her/his test.Your program should output student name,test average and a letter grade.NOTE:to get credit you must write at least one function.
(if average >= 90,A,>=80,B etc.).
请高手帮我写个程序 要求输出的结果是 输入进去的有多少学生就输出每个学生的名字 平均成绩和 平均成绩得到的等级 >=90是A 80-90 B 70-80C 60-70 D 60以下F
需求不是很明确
简单起见 输入一个学生的信息处理并输出一个
程序如下
PS: 60以下为E
#include <stdio.h>char get_grade(float ave)
{
if(ave >= 90) return 'A';
if(ave >= 80) return 'B';
if(ave >= 70) return 'C';
if(ave >= 60) return 'D';
return 'E';
}
float calc_ave(char *name)
{
int n, i, s=0, t;
printf("How many tests for %s?\n", name);
scanf("%d", &n);
printf("Please input %d tests' scores\n", n);
for(i = 0; i < n; i ++)
{
scanf("%d", &t);
s += t;
}
return (float)s/n;
}
void main()
{
char name[20];
char grade;
float ave;
int n, i;
printf("How many students?\n");
scanf("%d", &n);
for(i = 1; i <= n; i ++)
{
printf("What's the name of %d%s students?\n", i, i%10 == 1 ? "st" : i%10==2?"nd":i%10==3?"rd":"th");
scanf("%s", name);
ave=calc_ave(name);
grade = get_grade(ave);
printf("%s %.2f %c\n", name, ave, grade);
}
}
可以帮我写出这个C语言程序来吗 Write a complete program that prompts how many students?reads the number.Make a loop for that many students,prompts the first student for name and how many tests,get name,number of tests.Make a loop to sum
请大侠帮我解决C语言 下列程序在运行时输入12.8,写出结果.
给我解释一下这个C语言程序,我看不懂绕不过弯来,那么多for循环
能不能帮我做几道C语言题?如题读程序写出程序执行结果#include void main(){ int i=0,a=0;while( i
有没有软件可以把英语文章中每个词都挑出来,然后计算每个单词在文章中出现的总次数?谁帮我用c语言便一个程序,
..帮我设计一下这个程序S=2^2/(1*3)*4^2/(3*5)*...*(2n)^2/((2n-1)*(2n+1)) 用C语言..
帮我解决下这个C语言问题/*------------------------------------------------------【程序改错】--------------------------------------------------------题目:下面函数chnum将一个整数字符串转换为一个整数.--------------
C语言程序实验设计我对C语言是一窍不通,但要做实验,希望大家帮我做一下这几个实验,主要写一下程序和帮我讲解一下这个程序是怎样的:(1)设某城市的CO2排放量年增长率为0.5%,计算20年后
谁帮我用C语言编一个程序求任意圆的面积?
C语言 函数部分 阅读程序 写结果问题怎么回事?麻烦帮我讲解下
求高手帮我解决下面的问题C语言编的程序这是编译时提示的错误程序有点小长,不能粘贴过来,可以帮忙的,我给你发过去
这个荀字怎么读,帮我写出拼音来
C语言求导问题我想用C语言编一个求导的函数,具体想法是先输入函数的最高次数,然后依次输入每一项前的系数.有没有高手能帮我写下这个程序?
有懂这个语言的吗?可以帮我翻译吗?Pouvez_vous me pense,ah,sucer
可以帮我写一个虚拟仪器的程序框图吗
C语言,根据特定英文输出句子我想写一个简单的对话程序假定我输入 time能不能让程序输出 I don'know这个能用if语句来判断么
c语言,请解释一下我画波浪线的地方.这个程序几乎全看不懂.
有没有人可以帮我解释一下下面的C语言程序main(){int a,b,c,max; printf(input three numbers:
); scanf(%d,%d,%d,&a,&b,&c); max=a; if(max