#include <stdio.h> #include <stdlib.h> #include <string.h>
struct STU { long Num; int mathScore; int englishScore; puterScore; int allScore; int averageScore; };
void sort(); void cal(); void stuPrint(); void stuInput();
#define STUNUM 60/*定义学生数*/
STU stu[STUNUM];
int main(int argc, char* argv[]) { stuInput(); cal(); sort(); stuPrint();
return 0; }
void stuInput() { int i = 0; for (;i<STUNUM;i++) { system("cls"); printf("请一个学生输入学号 "); scanf("%d",&(stu[i].Num)); printf("请输入该学生数学成绩 "); scanf("%d",&(stu[i].mathScore)); printf("请输入该学生英语成绩 "); scanf("%d",&(stu[i].englishScore)); printf("请输入该学生计算机成绩 "); scanf("%d",&(stu[i]puterScore)); } }
void cal() { int i = 0; for (;i<STUNUM;i++) { stu[i].allScore = stu[i].mathScore + stu[i]puterScore + stu[i].englishScore; stu[i].averageScore = stu[i].allScore / 3; } }
void sort() { STU temp; int i = 0 , j =0; for (;i<STUNUM-1;i++) { for ( j = i+1;j< STUNUM ;j++) { if (stu[i].allScore<stu[j].allScore) {
memcpy(&temp,&stu[i],sizeof(STU)); memcpy(&stu[i],&stu[j],sizeof(STU)); memcpy(&stu[j],&temp,sizeof(STU)); } } }
}
void stuPrint() { int i = 0; printf("名次 学号 数学成绩 英语成绩 计算机成绩 总成绩 平均成绩 "); for (;i<STUNUM;i++) { printf(" --------------------------------------------------------- "); printf("%d %d %d %d %d %d %d ",i+1,stu[i].Num,stu[i].mathScore, stu[i].englishScore,stu[i]puterScore, stu[i].allScore,stu[i].averageScore);
}
}
melbicom从2015年就开始运作了,在国内也是有一定的粉丝群,站长最早是从2017年开始介绍melbicom。上一次测评melbicom是在2018年,由于期间有不少人持续关注这个品牌,而且站长貌似也听说过路由什么的有变动的迹象。为此,今天重新对莫斯科数据中心的VPS进行一次简单测评,数据仅供参考。官方网站: https://melbicom.net比特币、信用卡、PayPal、支付宝、银联...
RAKsmart 商家我们肯定不算陌生,目前主要的营销客户群肯定是我们。于是在去年的时候有新增很多很多的机房,比如也有测试过的日本、香港、美国机房,这不今年有新增韩国机房(记得去年是不是也有增加过)。且如果没有记错的话,之前VPS主机也有一次磁盘故障的问题。 这不今天有看到商家新增韩国服务器产品,当然目前我还不清楚商家韩国服务器的线路和速度情况,后面我搞一台测试机进行...
久久网云怎么样?久久网云好不好?久久网云是一家成立于2017年的主机服务商,致力于为用户提供高性价比稳定快速的主机托管服务,久久网云目前提供有美国免费主机、香港主机、韩国服务器、香港服务器、美国云服务器,香港荃湾CN2弹性云服务器。专注为个人开发者用户,中小型,大型企业用户提供一站式核心网络云端服务部署,促使用户云端部署化简为零,轻松快捷运用云计算!多年云计算领域服务经验,遍布亚太地区的海量节点为...