当前位置:网站首页>PTA 1102 teaching Super Champion volume
PTA 1102 teaching Super Champion volume
2022-07-07 18:56:00 【Deng sb's father】
1102 Teach Super Champion
#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;
}
边栏推荐
- Antisamy: a solution against XSS attack tutorial
- Learn open62541 -- [67] add custom enum and display name
- 标准ACL与扩展ACL
- 链式二叉树的基本操作(C语言实现)
- Reinforcement learning - learning notes 8 | Q-learning
- Live broadcast software construction, canvas Text Bold
- Complete e-commerce system
- 卖空、加印、保库存,东方甄选居然一个月在抖音卖了266万单书
- 来了!GaussDB(for Cassandra)新特性亮相
- Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
猜你喜欢
GSAP animation library
小试牛刀之NunJucks模板引擎
Will low code help enterprises' digital transformation make programmers unemployed?
Summary of evaluation indicators and important knowledge points of regression problems
Kirk Borne的本周学习资源精选【点击标题直接下载】
Reuse of data validation framework Apache bval
持续测试(CT)实战经验分享
现货白银分析中的一些要点
小程序中实现付款功能
如何选择合适的自动化测试工具?
随机推荐
nest.js入门之 database
Live broadcast software construction, canvas Text Bold
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
6.关于jwt
Learn open62541 -- [67] add custom enum and display name
Kirk borne's selection of learning resources this week [click the title to download directly]
Disk storage chain B-tree and b+ tree
嵌入式C语言程序调试和宏使用的技巧
Backup Alibaba cloud instance OSS browser
Is it safe to open an online futures account now? How many regular futures companies are there in China?
nest. Database for getting started with JS
高考填志愿规则
行业案例|数字化经营底座助力寿险行业转型
Differences between rip and OSPF and configuration commands
线程池中的线程工厂
Tsinghua, Cambridge and UIC jointly launched the first Chinese fact verification data set: evidence-based, covering many fields such as medical society
Kubernetes DevOps CD工具对比选型
PIP related commands
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
How to clean when win11 C disk is full? Win11 method of cleaning C disk