#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);
}
}
justhost.ru官方来消息说已经对网络进行了比较全面的优化,针对中国电信、联通、移动来说,4个机房总有一个适合中国用户,让站长进行一下测试,这不就有了这篇有关justhost的VPS的第四次测评。本帖主要关注的是网络,对于其他的参数一概不管! 官方网站:https://justhost.ru 最低配VPS:8.3元/月,KVM,512M内存,5G硬盘,200M带宽,不限流量 购买链接:...
spinservers是一家主营国外服务器租用和Hybrid Dedicated等产品的商家,Majestic Hosting Solutions LLC旗下站点,商家数据中心包括美国达拉斯和圣何塞机房,机器一般10Gbps端口带宽,且硬件配置较高。目前,主机商针对达拉斯机房机器提供优惠码,最低款Dual E5-2630L v2+64G+1.6TB SSD月付89美元起,支持PayPal、支付宝等...
这个月11号ShockHosting发了个新上日本东京机房的邮件,并且表示其他机房可以申请转移到日本,刚好赵容手里有个美国的也没数据就发工单申请新开了一个,这里做个简单的测试,方便大家参考。ShockHosting成立于2013年,目前提供的VPS主机可以选择11个数据中心,包括美国洛杉矶、芝加哥、达拉斯、杰克逊维尔、新泽西、澳大利亚、新加坡、日本、荷兰和英国等。官方网站:https://shoc...