1147[谁拿了最多奖学金]
来源:互联网 发布:淘宝买家故意损坏 编辑:程序博客网 时间:2024/06/12 01:37
题目懒得复制了
意思就是根据要求谁拿了最多的奖学金。
思路是给学生建立一个struct,然后进行那些麻烦判断。
直接放代码
#include<iostream>#include<string>#include<algorithm>using namespace std;struct Student{string name;int end;int cla;char moni;char west;int arti;int money;};int main(){int count, m;int all = 0;int max = 0;cin >> count;Student stu[100];for( int i = 0; i < count; i++){cin >> stu[i].name >> stu[i].end >> stu[i].cla >> stu[i].moni >>stu[i].west >> stu[i].arti;stu[i].money = 0;if( stu[i].end > 80 && stu[i].arti >= 1 )stu[i].money += 8000;if( stu[i].end > 85 && stu[i].cla > 80 )stu[i].money +=4000;if( stu[i].end > 90 )stu[i].money += 2000;if( stu[i].end > 85 && stu[i].west == 'Y' )stu[i].money += 1000;if( stu[i].cla > 80 && stu[i].moni == 'Y' )stu[i].money += 850;if( stu[i].money > max ){max = stu[i].money;m = i;}all += stu[i].money;}cout << stu[m].name << endl;cout << max <<endl;cout << all << endl;//system("pause");return 0;}
- 1147[谁拿了最多奖学金]
- 谁拿了最多奖学金
- 谁拿了最多奖学金
- 谁拿了最多奖学金
- 谁拿了最多奖学金
- 谁拿了最多奖学金
- 谁拿了最多奖学金
- Sicily 1147 谁拿了最多的奖学金
- tyvj P1002:谁拿了最多奖学金
- 1147. 谁拿了最多奖学金
- 谁拿了最多的奖学金
- Sicily 1147. 谁拿了最多奖学金
- 【模拟】谁拿了最多奖学金
- sicily--1147. 谁拿了最多奖学金
- vijos P1001 谁拿了最多奖学金
- 【模拟】谁拿了最多奖学金
- 1147. 谁拿了最多奖学金
- 1147. 谁拿了最多奖学金
- TI81xx PCIe多路视频采集卡方案
- 菜鸟的spring 3.0源码学习之旅(1)
- 游戏开发工具与SDK
- 黑马程序员_<<基础加强---反射>>
- APP快速通过苹果AppStore审核九大诀窍
- 1147[谁拿了最多奖学金]
- python 下载指定网页上得图片
- STC12C5A60S2 PCA模块输出占空比可调PWM波形
- linux网络协议栈3
- Android APIDemos 研读之一:android.graphics.Movie
- Android ContactsProvider源码分析
- cocos2d-x ActionManager控制精灵的暂停运动
- 如何找到人体毒素与有效排毒?
- 跟我一起写 Makefile