www.rtmj.net > 用C语言编写一个程序,输入一个成绩,判断该成绩是...

用C语言编写一个程序,输入一个成绩,判断该成绩是...

#include int main(){ int i,score;printf("Enter Grade: \n");scanf("%d",&score);switch(score/60){ case 1:printf("Pass\n");break; case 0:printf("Fail\n");break; }return 0;}/*输出:Enter Grade:59Fail*/

if语句: #include #include int main(int aragc, char *argv[]) { int score; int ret; printf("please input score:\n"); while(1){ ret = scanf("%d", &score); if (ret){ if (score >= 90){ printf("A\n"); } else if (score >= 80) printf(...

#include main() { double grade[200]; double sum,avg,temp; int count,i,n; i=0; count=0; sum=0; printf("请依次输入每个同学的成绩,输入-1结束\n"); scanf("%lf",&temp); while(temp!=-1) { grade[i++]=temp; count++; sum=sum+temp; scanf...

//满意请采纳#includevoid prin(int*a);int main(){int a[5]={0},n,i,sum=0;for(i=0;i

一、首先打开VC++ 二、文件》》新建 三、创建一个C++空白文档头文件是必须声明的# include 四、说下主体思想我们定义一个求每门课平均成绩的函数AverageCourse它的形参一个是二维数组,用来传递学生成绩;一个是指针变量(数组名),存放每门课...

#include int main() { int i=0; double sum=0,temp; for(i=0;i

求该学生六门课的什么?总分?平均分?题主貌似没有表述清楚哈 我先帮题主实现录入成绩,计算总分、均分,及按总分由高到低排序功能吧 #include#define N 6 /*定义6门课*/struct student { int no; /*学号*/ char name[20]; /*姓名*/float score...

#includeint main(){float grade;float sum = 0;float maxGrade = 0;int cnt = 0;int y = 0;while(1){printf("please enter grade:");scanf("%f",&grade);if(maxGrade < grade){maxGrade = grade;}sum += grade;cnt++;printf("continue press 1,...

#include "stdio.h" int main(int argc, char* argv[]) { int a,b,c,d,e,; printf("请输入五门课程成绩,以空格隔开:\n"); scanf("%d%d%d",&a,&b,&c,&d,&e); int sum = a + b + c;//总成绩 int average = sum / 5; //总成绩除5的余值 = 平均成绩...

#include #include #define N 20 typedef struct Student { char name[10]; int no; //学号 int grade;//成绩 }Student; void Input(Student *stud ,int n); int main(void) { int low, high; printf("请输入成绩区间low-high\n"); scanf("%d %d...

网站地图

All rights reserved Powered by www.rtmj.net

copyright ©right 2010-2021。
www.rtmj.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com