当前位置:网站首页>PTA 1102 教超冠军卷
PTA 1102 教超冠军卷
2022-07-07 16:49:00 【邓某人的父亲】
1102 教超冠军卷
#include <iostream>
using namespace std;
struct paper
{
string ID;
int price;
int Purchases;
long long int products;
};
int main()
{
int N;
cin >> N;
paper p[N];
for (int i = 0; i < N; i++)
{
cin >> p[i].ID >> p[i].price >> p[i].Purchases;
p[i].products = p[i].price * p[i].Purchases;
}
paper maxPorchases = p[0];
paper maxProducts = p[0];
for (int i = 0; i < N; i++)
{
if (maxPorchases.Purchases < p[i].Purchases)
maxPorchases = p[i];
if (maxProducts.products < p[i].products)
maxProducts=p[i];
}
cout<<maxPorchases.ID<<" "<<maxPorchases.Purchases<<"\n";
cout<<maxProducts.ID<<" "<<maxProducts.products;
}
边栏推荐
- Will low code help enterprises' digital transformation make programmers unemployed?
- Redis
- Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
- 2022年理财有哪些产品?哪些适合新手?
- Unlike the relatively short-lived industrial chain of consumer Internet, the industrial chain of industrial Internet is quite long
- CVPR 2022丨学习用于小样本语义分割的非目标知识
- 2022年推荐免费在线接收短信平台(国内、国外)
- [paddleseg source code reading] add boundary IOU calculation in paddleseg validation (1) -- val.py file details tips
- DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon
- Tips of the week 136: unordered containers
猜你喜欢
Do you really understand sticky bag and half bag? 3 minutes to understand it
DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon
Nat address translation
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
RIP和OSPF的区别和配置命令
Discuss | what preparations should be made before ar application is launched?
Introduction de l'API commune de programmation de socket et mise en œuvre de socket, select, Poll et epoll
Summary of debian10 system problems
Improve application security through nonce field of play integrity API
Learn to make dynamic line chart in 3 minutes!
随机推荐
简单几步教你如何看k线图图解
Simple configuration of single arm routing and layer 3 switching
Tear the Nacos source code by hand (tear the client source code first)
Discuss | what preparations should be made before ar application is launched?
Thread pool and singleton mode and file operation
Introduction de l'API commune de programmation de socket et mise en œuvre de socket, select, Poll et epoll
Nunjuks template engine
CVPR 2022丨学习用于小样本语义分割的非目标知识
nest. Database for getting started with JS
2022年理财产品的一般收益率是多少?
【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的
DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon
coming! Gaussdb (for Cassandra) new features appear
Idea completely uninstalls installation and configuration notes
将模型的记忆保存下来!Meta&UC Berkeley提出MeMViT,建模时间支持比现有模型长30倍,计算量仅增加4.5%...
Wireshark analyzes packet capture data * cap
RIP和OSPF的区别和配置命令
讨论 | AR 应用落地前,要做好哪些准备?
线程池的拒绝策略
[PaddleSeg源码阅读] PaddleSeg Validation 中添加 Boundary IoU的计算(1)——val.py文件细节提示