当前位置:网站首页>PTA 1102 教超冠军卷
PTA 1102 教超冠军卷
2022-07-07 16:49:00 【邓某人的父亲】
1102 教超冠军卷
#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;
}
边栏推荐
- Rules for filling in volunteers for college entrance examination
- [trusted computing] Lesson 13: TPM extended authorization and key management
- 面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
- What are the financial products in 2022? What are suitable for beginners?
- 小试牛刀之NunJucks模板引擎
- 静态路由配置
- Will low code help enterprises' digital transformation make programmers unemployed?
- 学习open62541 --- [67] 添加自定义Enum并显示名字
- The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
- pip相关命令
猜你喜欢
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%
【蓝桥杯集训100题】scratch从小到大排序 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第17题
The highest level of anonymity in C language
【Unity Shader】插入Pass实现模型遮挡X光透视效果
五种网络IO模型
Calculation of torque target value (ftorque) in servo torque control mode
Disk storage chain B-tree and b+ tree
Tips of the week 136: unordered containers
磁盘存储链式的B树与B+树
学习open62541 --- [67] 添加自定义Enum并显示名字
随机推荐
Thread pool and singleton mode and file operation
Learn to make dynamic line chart in 3 minutes!
golang 客户端服务端登录
高考填志愿规则
What are the financial products in 2022? What are suitable for beginners?
Discuss | frankly, why is it difficult to implement industrial AR applications?
Tear the Nacos source code by hand (tear the client source code first)
[tpm2.0 principle and Application guide] Chapter 5, 7 and 8
Debian10 compile and install MySQL
【C语言】字符串函数
讨论 | AR 应用落地前,要做好哪些准备?
Differences between rip and OSPF and configuration commands
五种网络IO模型
Standard ACL and extended ACL
直播软件搭建,canvas文字加粗
String type, constant type and container type of go language
[trusted computing] Lesson 10: TPM password resource management (II)
强化学习-学习笔记8 | Q-learning
How to clean when win11 C disk is full? Win11 method of cleaning C disk
[trusted computing] Lesson 11: TPM password resource management (III) NV index and PCR