当前位置:网站首页>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;
}
边栏推荐
- 回归问题的评价指标和重要知识点总结
- The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving
- Embedded interview questions (algorithm part)
- 數據驗證框架 Apache BVal 再使用
- Continuous test (CT) practical experience sharing
- Using stored procedures, timers, triggers to solve data analysis problems
- 2022年理财产品的一般收益率是多少?
- 不能忽略的现货白银短线操作小技巧
- Wireshark分析抓包数据*.cap
- Introduction of common API for socket programming and code implementation of socket, select, poll, epoll high concurrency server model
猜你喜欢

DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon

Calculation of torque target value (ftorque) in servo torque control mode

Simple configuration of single arm routing and layer 3 switching

直播预约通道开启!解锁音视频应用快速上线的秘诀

The performance and efficiency of the model that can do three segmentation tasks at the same time is better than maskformer! Meta & UIUC proposes a general segmentation model with better performance t

不能忽略的现货白银短线操作小技巧

磁盘存储链式的B树与B+树

gsap动画库

Reinforcement learning - learning notes 8 | Q-learning

通过 Play Integrity API 的 nonce 字段提高应用安全性
随机推荐
2022-07-04 matlab读取视频帧并保存
[unity shader] insert pass to realize the X-ray perspective effect of model occlusion
Save the memory of the model! Meta & UC Berkeley proposed memvit. The modeling time support is 30 times longer than the existing model, and the calculation amount is only increased by 4.5%
PTA 1101 B是A的多少倍
线程池和单例模式以及文件操作
Improve application security through nonce field of play integrity API
【剑指 Offer】59 - I. 滑动窗口的最大值
gsap动画库
Redis publishing and subscription
【塔望方法论】塔望3W消费战略 - U&A研究法
Wireshark analyzes packet capture data * cap
Download, installation and development environment construction of "harmonyos" deveco
Yearning-SQL审核平台
[C language] string function
debian10编译安装mysql
Learn open62541 -- [67] add custom enum and display name
Kirk Borne的本周学习资源精选【点击标题直接下载】
debian10系统问题总结
The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
Thread factory in thread pool