1.用C语言统计出若干个学生的平均成绩和低于平均分的人数.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/11 08:36:46
根据提示做是没问题的.先定义数组:intA[50];在提示基础上略加修改:inti=0,sum=0;floatavg;for(;scanf("%d",&A[i])==1&&i
#includeintInput(ints[]){intn=0;scanf("%d",s);while(*s!=0){n++;s++;scanf("%d",s);}returnn;}voidstati
代码如下#includeintasd(inta){inti,t=0;for(i=2;i
#includemain(){inti;intj=1;//j为当前输入的学生号码intk,l;//用于接受学生课程的成绩intm=0,n=0;//接受1门及格的和两门及格的printf("请
#includevoidmain(){charline[30];inti,count1=0,count2=0,count3=0,count4=0;printf("\n请输入一行字符:");gets(l
#includevoidmain(){charc;intletter=0;printf("请输入一行字符:\n");while((c=getchar())!='\n'){if(c>='a'&&c='A
#include#include#includeintmain(){inti,a[200]={0};charc;for(i=0;;i++){scanf("%c",&c);if(c=='\n')brea
#includemain(){intyear,cnt=0;for(year=1960;yea
#includeinta[10],i,j=0,k=0;for(i=0;i
#include "stdio.h"#define N 10void main(){ int a[N],ave,sum=
#include<stdio.h>void main(){ int sum=0; &nb
#includevoidmain(){floats=0;intn=0,k=0;//k值用来统计学生的总数while(n>=0&&n
#include#defineM6#defineN5floataverage(float*p,intn)/*求平均分的函数*/{floatsum=0.;inti;for(i=0;i
#include#defineMAX10//定义学生人数structstudent//定义学生结构体{charname[15];longnum[10];floatscore[3];floatave;}
inta,sum,count;doubleavg;sum=0;count=0;while(1){printf("请输入正整数(输入0结束输入):");scanf("%d",&a);if(a==0){b
#include#defineM4#defineN3voidmain(){floatscore[M],add[N]={0},k[M]={0};inti,j;for(i=0;i
#includemain(){\x09inta[10];\x09intn1=0,n2=0,n3=0,n4=0;\x09inti;\x09printf("请输入10个学生成绩,每输入一个成绩,回车一次:
#includeintmain(){\x09inti,A,B,C,D,E,n,s;\x09A=B=C=D=E=0;\x09printf("Entern:");\x09scanf("%d",&n);\x
#includevoidmain(){inti,arr[10];intsum=0;intcount=0;doubleavg=0;for(i=0;i!=10;++i){scanf("%d
#include "stdio.h"int main() {int n, sum=0, i=0, max,&