当前位置:网站首页>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;
}
边栏推荐
- DeSci:去中心化科学是Web3.0的新趋势?
- Embedded interview questions (algorithm part)
- socket編程之常用api介紹與socket、select、poll、epoll高並發服務器模型代碼實現
- The highest level of anonymity in C language
- 同消费互联网的较为短暂的产业链不同,产业互联网的产业链是相当漫长的
- 直播预约通道开启!解锁音视频应用快速上线的秘诀
- Interview vipshop internship testing post, Tiktok internship testing post [true submission]
- Do you really understand sticky bag and half bag? 3 minutes to understand it
- 二叉树的基本概念和性质
- PIP related commands
猜你喜欢

Idea completely uninstalls installation and configuration notes

How to clean when win11 C disk is full? Win11 method of cleaning C disk

Summary of evaluation indicators and important knowledge points of regression problems
![Kirk borne's selection of learning resources this week [click the title to download directly]](/img/df/98aa3edf0a70b870684963d52e7c72.png)
Kirk borne's selection of learning resources this week [click the title to download directly]

线程池和单例模式以及文件操作

Cadre de validation des données Apache bval réutilisé

Debian10 compile and install MySQL

3.关于cookie

Charles+drony的APP抓包

debian10系统问题总结
随机推荐
不能忽略的现货白银短线操作小技巧
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
Redis cluster and expansion
Tips for short-term operation of spot silver that cannot be ignored
pip相关命令
Is it safe to open an online futures account now? How many regular futures companies are there in China?
Cloud security daily 220707: Cisco Expressway series and telepresence video communication server have found remote attack vulnerabilities and need to be upgraded as soon as possible
AntiSamy:防 XSS 攻击的一种解决方案使用教程
Discuss | frankly, why is it difficult to implement industrial AR applications?
PTA 1101 B是A的多少倍
完整的电商系统
Calculation of torque target value (ftorque) in servo torque control mode
Will low code help enterprises' digital transformation make programmers unemployed?
Rules for filling in volunteers for college entrance examination
PTA 1102 教超冠军卷
Tsinghua, Cambridge and UIC jointly launched the first Chinese fact verification data set: evidence-based, covering many fields such as medical society
Discuss | what preparations should be made before ar application is launched?
国内的软件测试会受到偏见吗
socket編程之常用api介紹與socket、select、poll、epoll高並發服務器模型代碼實現
nest.js入门之 database