当前位置:网站首页>洛谷 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);
}
边栏推荐
- [understanding of opportunity -29]: Guiguzi - internal dialogue - five levels of communication with superiors
- [image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code
- How to open the soft keyboard in the computer, and how to open the soft keyboard in win10
- Extend ado Net to realize object-oriented CRUD (.Net core/framework)
- 简单的折射效果
- Ultra wideband pulse positioning scheme, UWB precise positioning technology, wireless indoor positioning application
- bjdctf_ 2020_ babystack
- bjdctf_2020_babystack
- Global and Chinese market of offshore furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
- Common coding and encryption in penetration testing
猜你喜欢

Win11 points how to divide disks? How to divide disks in win11 system?

MySQL - three tables (student, course, score) to query the name, number and score of students whose course is mathematics

get_ started_ 3dsctf_ two thousand and sixteen

PIP install XXX on the terminal but no module named XXX on pycharm

More than 60 million shovel excrement officials, can they hold a spring of domestic staple food?

MaxCompute远程连接,上传、下载数据文件操作

Camera calibration (calibration purpose and principle)

Alibaba cloud full link data governance

Description of module data serial number positioning area code positioning refers to GBK code

bjdctf_2020_babystack
随机推荐
MaxCompute远程连接,上传、下载数据文件操作
屏幕截图推荐—Snipaste
选择器(>,~,+,[])
bjdctf_ 2020_ babystack
UE常用控制台命令
Counter attack from outsourcing to big factories! Android has been developed for 5 years, and after a year of dormancy, it has tried to become an offer harvester. Tencent has a fixed salary of 20*15
[image fusion] multi focus and multi spectral image fusion based on pixel saliency and wavelet transform with matlab code
[frame rate doubling] development and implementation of FPGA based video frame rate doubling system Verilog
What should I pay attention to after the live broadcast system source code is set up?
[image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code
希尔伯特-黄变换
PCL point cloud random sampling by ratio
Tidb operator source code reading (IV) control cycle of components
【Django中运行scrapy框架,并将数据存入数据库】
Black box and white box models for interpretable AI
阿里云全链路数据治理
Spark stage and shuffle for daily data processing
Étalonnage de la caméra (objectif et principe d'étalonnage)
[GUET-CTF2019]zips
[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence