s = n;
while (n--) { stu[count].scholarship = 0; printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ if (stu[count].finalScore > 90) { stu[count].scholarship += 2000; } if (stu[count].finalScore > 85&& stu[count].classScore>80) { stu[count].scholarship += 4000; } if(stu[count].classScore>80) { if (stu[count].work != 78) { stu[count].scholarship += 850; } } if (stu[count].finalScore>85) { if (stu[count].west != 78) { stu[count].scholarship += 1000; } } if (stu[count].finalScore > 80 && stu[count].paper) { stu[count].scholarship += 8000;
} printf(\ count++; }
int max; count = 0;
max = stu[0].scholarship; for (i = 0; i < s; i++) { if (max < stu[i].scholarship) { max = stu[i].scholarship; count = i; } }
printf(\ }
3评选最牛群主v1.0(4分) 题目内容:
现在要评选最牛群主,已知有3名最牛群主的候选人(分别是tom,jack和rose),有不超过1000人参与投票,最后要通过投票评选出一名最牛群主,从键盘输入每位参与投票的人的投票结果,即其投票的候选人的名字,请你编程统计并输出每位候选人的得票数,以及得票数最多的候选人的名字。候选人的名字中间不允许出现空格,并且必须小写。若候选人名字输入错误,则按废票处理。
程序运行结果示例1:
Input the number of electorates:8↙ Input vote 1:tom↙ Input vote 2:jack↙ Input vote 3:rose↙ Input vote 4:tom↙ Input vote 5:rose↙ Input vote 6:rose↙ Input vote 7:jack↙ Input vote 8:rose↙ Election results: tom:2
jack:2 rose:4 rose wins
程序运行结果示例2:
Input the number of electorates:5↙ Input vote 1:tom↙ Input vote 2:mary↙ Input vote 3:rose↙ Input vote 4:jack↙ Input vote 5:tom↙ Election results: tom:2 jack:1 rose:1 tom wins
提示输入候选人数量:\提示输入候选人: \输入格式:
输入候选人数量:\ 输入候选人姓名:\ 输出格式:
输出候选人得票数:\
输出票数最多的候选人姓名:\输出评选结果提示信息:\
代码:
#include
{ vote2++; } else if (strcmp(\ { vote3++; } } printf(\ printf(\ printf(\ printf(\ if (vote1>vote2&&vote1>vote3) { printf(\ } else if (vote2>vote1&&vote2>vote3) { printf(\ } else { printf(\ } return 0; }
4.星期判断(4分)
题目内容:请输入星期几的第一个字母(不区分大小写)来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母(小写),否则输出“data error”。 程序运行结果示例1:
please input the first letter of someday: S↙
please input second letter: u↙ sunday
程序运行结果示例2:
please input the first letter of someday: F↙ friday
程序运行结果示例2:
please input the first letter of someday:
相关推荐: