当前位置:网站首页>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;
}
边栏推荐
- 将模型的记忆保存下来!Meta&UC Berkeley提出MeMViT,建模时间支持比现有模型长30倍,计算量仅增加4.5%...
- Calculation of torque target value (ftorque) in servo torque control mode
- 来了!GaussDB(for Cassandra)新特性亮相
- socket编程之常用api介绍与socket、select、poll、epoll高并发服务器模型代码实现
- [principles and technologies of network attack and Defense] Chapter 3: network reconnaissance technology
- debian10系统问题总结
- Skills of embedded C language program debugging and macro use
- Comparison and selection of kubernetes Devops CD Tools
- [principle and technology of network attack and Defense] Chapter 6: Trojan horse
- Using stored procedures, timers, triggers to solve data analysis problems
猜你喜欢
Industry case | digital operation base helps the transformation of life insurance industry
3分钟学会制作动态折线图!
Tear the Nacos source code by hand (tear the client source code first)
持续测试(CT)实战经验分享
企业展厅设计中常用的三种多媒体技术形式
Disk storage chain B-tree and b+ tree
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
Learn to make dynamic line chart in 3 minutes!
上市十天就下线过万台,欧尚Z6产品实力备受点赞
[principles and technologies of network attack and Defense] Chapter 5: denial of service attack
随机推荐
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
AntiSamy:防 XSS 攻击的一种解决方案使用教程
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
[trusted computing] Lesson 12: TPM authorization and conversation
The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
SQLite SQL exception near "with": syntax error
你真的理解粘包与半包吗?3分钟搞懂它
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%
Redis
nest.js入门之 database
用存储过程、定时器、触发器来解决数据分析问题
手撕Nacos源码(先撕客户端源码)
debian10系统问题总结
性能测试过程和计划
Win11C盘满了怎么清理?Win11清理C盘的方法
PHP面试题 foreach($arr as &$value)与foreach($arr as $value)的用法
Classification of regression tests
低代码助力企业数字化转型会让程序员失业?
Wireshark analyzes packet capture data * cap
简单几步教你如何看k线图图解