当前位置:网站首页>洛谷 P1051 谁拿了最多奖学金
洛谷 P1051 谁拿了最多奖学金
2022-06-24 06:44:00 【邓某人的父亲】
P1051 谁拿了最多奖学金
#include <iostream>
using namespace std;
struct student
{
string name;
int grade1, grade2;
char identy1, identy2;
int papers;
int money=0;
};
int main()
{
int n;
cin >> n;
student stu[n];
student Max;
int sum=0;
for (int i = 0; i < n; i++)
{
cin >> stu[i].name >> stu[i].grade1 >> stu[i].grade2 >> stu[i].identy1 >> stu[i].identy2 >> stu[i].papers;
stu[i].money=0;
if(stu[i].grade1>80&&stu[i].papers>0)
stu[i].money+=8000;
if(stu[i].grade1>85&&stu[i].grade2>80)
stu[i].money+=4000;
if(stu[i].grade1>90)
stu[i].money+=2000;
if(stu[i].grade1>85&&stu[i].identy2=='Y')
stu[i].money+=1000;
if(stu[i].grade2>80&&stu[i].identy1=='Y')
stu[i].money+=850;
if(Max.money<stu[i].money)
Max=stu[i];
sum+=stu[i].money;
}
printf("%s\n%d\n%d\n",Max.name.c_str(),Max.money,sum);
}
边栏推荐
- 选择器(>,~,+,[])
- Session & cookie details
- 爬虫基础B1——Scrapy(B站学习笔记)
- 使用SystemParametersInfo访问用户界面设置
- L2tp/ipsec one click installation script
- UTC、GMT、CST
- 相機標定(標定目的、原理)
- 屏幕截图推荐—Snipaste
- [vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence
- Global and Chinese market of Earl Grey tea 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

jarvisoj_ level2

How to turn on win11 notebook power saving mode? How to open win11 computer power saving mode
![选择器(>,~,+,[])](/img/7e/2becfcf7a7b2e743772deee5916caf.png)
选择器(>,~,+,[])

屏幕截图推荐—Snipaste

6000多万铲屎官,捧得出一个国产主粮的春天吗?
![buuctf misc [UTCTF2020]docx](/img/e4/e160f704d6aa754e85056840e14bd2.png)
buuctf misc [UTCTF2020]docx

使用SystemParametersInfo访问用户界面设置

bjdctf_2020_babystack

【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现

爬虫基础B1——Scrapy(B站学习笔记)
随机推荐
[GUET-CTF2019]zips
[OGeek2019]babyrop
Climbing 10000 NASA pictures about Mars exploration, I found a secret
How to delete / select an input method on your computer
[MySQL usage Script] clone data tables, save query data to data tables, and create temporary tables
湖北专升本-湖师计科
Tidb operator source code reading (IV) control cycle of components
Deploy L2TP in VPN (Part 2)
Selector (>, ~, +, [])
How to connect the Bluetooth headset to the computer and how to connect the win10 computer to the Bluetooth headset
Global and Chinese market of anion sanitary napkins 2022-2028: Research Report on technology, participants, trends, market size and share
Bjdctf 2020 Bar _ Babystack
RDD的执行原理
2.1.1 QML grammar foundation I
C# Lambda
bjdctf_2020_babystack
Shell script for MySQL real-time synchronization of binlog
(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]
Obtain the package name, application name, icon, etc. of the uninstalled APK through packagemanager. There is a small message
What should I pay attention to after the live broadcast system source code is set up?