当前位置:网站首页>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;
}
边栏推荐
- 2022-07-04 matlab读取视频帧并保存
- Introduction of common API for socket programming and code implementation of socket, select, poll, epoll high concurrency server model
- Live broadcast software construction, canvas Text Bold
- [paddleseg source code reading] add boundary IOU calculation in paddleseg validation (1) -- val.py file details tips
- [C language] string function
- 学习open62541 --- [67] 添加自定义Enum并显示名字
- Is it safe to open an online futures account now? How many regular futures companies are there in China?
- App capture of charles+postern
- 将模型的记忆保存下来!Meta&UC Berkeley提出MeMViT,建模时间支持比现有模型长30倍,计算量仅增加4.5%...
- Standard ACL and extended ACL
猜你喜欢

Will low code help enterprises' digital transformation make programmers unemployed?

Continuous test (CT) practical experience sharing

【C语言】字符串函数

idea彻底卸载安装及配置笔记

Antisamy: a solution against XSS attack tutorial

海量数据去重的hash,bitmap与布隆过滤器Bloom Filter

Introduction de l'API commune de programmation de socket et mise en œuvre de socket, select, Poll et epoll

Hash, bitmap and bloom filter for mass data De duplication
![[论文分享] Where’s Crypto?](/img/27/9b47bfcdff8307e63f2699d6a4e1b4.png)
[论文分享] Where’s Crypto?

App capture of charles+postern
随机推荐
Discuss | what preparations should be made before ar application is launched?
Embedded interview questions (algorithm part)
socket编程之常用api介绍与socket、select、poll、epoll高并发服务器模型代码实现
Tips for short-term operation of spot silver that cannot be ignored
Redis
More than 10000 units were offline within ten days of listing, and the strength of Auchan Z6 products was highly praised
单臂路由和三层交换的简单配置
Nunjuks template engine
Continuous test (CT) practical experience sharing
卖空、加印、保库存,东方甄选居然一个月在抖音卖了266万单书
云景网络科技面试题【杭州多测师】【杭州多测师_王sir】
How to open an account for wealth securities? Is it safe to open a stock account through the link
Download, installation and development environment construction of "harmonyos" deveco
线程池中的线程工厂
Learn open62541 -- [67] add custom enum and display name
磁盘存储链式的B树与B+树
Redis
【Unity Shader】插入Pass实现模型遮挡X光透视效果
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
企业展厅设计中常用的三种多媒体技术形式