用C语言输入一个班的成绩
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/11 09:49:07
voidmain(){floatr,s,l;floatpi=3.1415;printf("输入一个圆的半径:\n");scanf("%f",&r);if(
main(){inti=0,k,count=0,sum=0;floatavg=0;printf("输入成绩:最后以-1结束");for(k=0;k
#includeintmain(){inti,j,a,b;scanf("%d\n",i);printf("pleaseinputnumber\n");scanf("%d\t",a);b=a;for(j
#includeintmain(){intn;charch;inti;printf("输入一个10以内的正整数和相应个数的五进制成绩:\n");scanf("%d",&n);for(i=0
#include#defineN30typedefstructstudent{\x09charname[10];\x09intscore;}STU;voidmain(){\x09STUs[N];\x0
#includeintmain(){charch;inti,x,n=0,s=0;for(i=1;;i++){printf("请输入学生成绩,以空格隔开,以回车结束:\n");scanf
把5个成绩加起来,除与5就得平均成绩.如:intscore[5]={90,80,80,95,87};intsum;sum=0;floatavg=0;for(inti=0;i
#includevoidmain(){inta;printf("请输入一个三位数:");scanf("%d",&a);printf("各位数上的乘积为:%d\n",(a/100)*(a%10)*(a/
#include<stdio.h>void main(){ int sum=0; &nb
voidmain(){floatsum=0,avg=0,min=100,max=0;intfail=0;for(i=0;i>a;sum+=a;if(min>a)min=a;if(max
写了一个,看看能不能帮到你#include#include#defineNUM50voidbubblesort(float*grade,char(*num)[20]){inti,j;floattemp
inta[5]={45,50,60,80,70};for(inti=0;i再问:要用键盘输入成绩哦再答:#includeintmain(){inta[5];int*p;p=a;for(intj=0;j
楼主犯了最基本的错误记得给变量赋初值#includevoidmain(){floatscore=0,average=0;intn=0;do{scanf("%f",&score);if(score>=0
#include <stdio.h>main(){ double grade[200]; double sum,avg,temp;&nbs
#includeintmain(){\x09inti,A,B,C,D,E,n,s;\x09A=B=C=D=E=0;\x09printf("Entern:");\x09scanf("%d",&n);\x
#includeintmain(){inti,n=0;floats[10];for(i=0;iscanf("%f",&s[i]);if(s[i]n++;}printf("及格人数:%d,及格率:%d\
一楼基本上是对的,不过循环这些有错,还是必须加上循环的中止条件,调试无误代码如下:#include"stdio.h"intmain(){\x09signedintn;//因为要与-1比较,所以n定义为
#includevoidmain(){inti,arr[10];intsum=0;intcount=0;doubleavg=0;for(i=0;i!=10;++i){scanf("%d
voidmain(){doublearr[50]={0};doubleaverage=0;printf("Input50StudentsScore:\n");for(inti=0;i
main里面的aver应该写成0.0,然后就是f2里面的i应该赋值为i=0