当前位置:网站首页>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;
}
边栏推荐
- 低代码助力企业数字化转型会让程序员失业?
- 面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
- Download, installation and development environment construction of "harmonyos" deveco
- Learn to make dynamic line chart in 3 minutes!
- 我感觉被骗了,微信内测 “大小号” 功能,同一手机号可注册两个微信
- 2022-07-04 matlab读取视频帧并保存
- 『HarmonyOS』DevEco的下载安装与开发环境搭建
- 线程池和单例模式以及文件操作
- Three forms of multimedia technology commonly used in enterprise exhibition hall design
- Kubernetes DevOps CD工具对比选型
猜你喜欢
Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
Summary of debian10 system problems
CVPR 2022 - learning non target knowledge for semantic segmentation of small samples
Kirk borne's selection of learning resources this week [click the title to download directly]
Nunjuks template engine
Antisamy: a solution against XSS attack tutorial
Download, installation and development environment construction of "harmonyos" deveco
String type, constant type and container type of go language
Discuss | frankly, why is it difficult to implement industrial AR applications?
Three forms of multimedia technology commonly used in enterprise exhibition hall design
随机推荐
单臂路由和三层交换的简单配置
学习open62541 --- [67] 添加自定义Enum并显示名字
debian10系统问题总结
行业案例|数字化经营底座助力寿险行业转型
卖空、加印、保库存,东方甄选居然一个月在抖音卖了266万单书
你真的理解粘包与半包吗?3分钟搞懂它
socket编程之常用api介绍与socket、select、poll、epoll高并发服务器模型代码实现
[demo] circular queue and conditional lock realize the communication between goroutines
AI defeated mankind and designed a better economic mechanism
微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
socket編程之常用api介紹與socket、select、poll、epoll高並發服務器模型代碼實現
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
磁盘存储链式的B树与B+树
C语言中匿名的最高境界
Charles+drony的APP抓包
Improve application security through nonce field of play integrity API
数据验证框架 Apache BVal 再使用
idea彻底卸载安装及配置笔记
Summary of debian10 system problems
Industry case | digital operation base helps the transformation of life insurance industry