当前位置:网站首页>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;
}
边栏推荐
- Three forms of multimedia technology commonly used in enterprise exhibition hall design
- 国内的软件测试会受到偏见吗
- Charles+Postern的APP抓包
- The highest level of anonymity in C language
- Will low code help enterprises' digital transformation make programmers unemployed?
- 微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
- Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
- Redis集群与扩展
- 单臂路由和三层交换的简单配置
- Thread factory in thread pool
猜你喜欢
Learn open62541 -- [67] add custom enum and display name
Complete e-commerce system
Redis
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
[paper sharing] where's crypto?
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
3.关于cookie
Some key points in the analysis of spot Silver
Cadre de validation des données Apache bval réutilisé
Comparison and selection of kubernetes Devops CD Tools
随机推荐
Live broadcast software construction, canvas Text Bold
不能忽略的现货白银短线操作小技巧
嵌入式C语言程序调试和宏使用的技巧
线程池中的线程工厂
完整的电商系统
[demo] circular queue and conditional lock realize the communication between goroutines
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
socket編程之常用api介紹與socket、select、poll、epoll高並發服務器模型代碼實現
二叉树的基本概念和性质
Redis的发布与订阅
Debian10 compile and install MySQL
String type, constant type and container type of go language
Yearning-SQL审核平台
Will domestic software testing be biased
NAT地址转换
Kirk borne's selection of learning resources this week [click the title to download directly]
gsap动画库
How to clean when win11 C disk is full? Win11 method of cleaning C disk
Improve application security through nonce field of play integrity API
链式二叉树的基本操作(C语言实现)