题目描述
The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its end, and people are eagerly waiting for the finals, which happened to be between the two most popular Iranian teams, Persepolis and Esteghlal.
The ICPC finals consist of two matches, with each team competing as the home team in one match. The winning team is determined by aggregate score, the sum of the scores of the two matches. For example, if the scores of the two matches
are Persepolis 6–0 Esteghlal in the first match, and Esteghlal 3–1 Persepolis in the second match, then the aggregate score will be Persepolis 7–3 Esteghlal, meaning that Persepolis is the winner. If aggregates are equal, the away goals rule is used to determine the winner, in which case the winner is the team that scored the most goals in the match it played away from home. If the result is still equal, a penalty shootout is required.
Hana, an avid football fan, is trying to figure out various scenarios in which her favorite team wins the finals. To this end, she aims to write a program that gets as input the number of goals in the two matches, and decides which team is the winner if it can be derived from the aggregate scores and the away goals rule, otherwise declares that the match goes to penalty kicks. You are going to help Hana write such a program.

输入
The first line of the input contains two space-separated integers p1 and s1 , where p1 and s1 are the number of goals scored by Persepolis and Esteghlal, respectively, in the first match in which Persepolis is the home team. The second line contains two space-separated integers s2 and p2 , where s2 and p2 are the number of goals scored by Esteghlal and Persepolis, respectively, in the second match in which Esteghlal is the home team. All input integers are between 0 and 20, inclusively.

输出
In the output, print the name of the winning team, either Persepolis or Esteghlal, if the winner can be determined by the aggregate scores and the away goals rule. Otherwise, print Penalty.

样例输入
3 0
2 1
样例输出
Persepolis

题目意思是说,给你两个队的比分,第一场的两个比分是 P队 + E队 ,第二场反过来为 E队 +P队,第一场是P队主场,第二场则是E队主场,比赛的规则是将这两场比赛的得分求和算作总得分,总得分高者获胜,总得分相同的情况下,选取客场得分多的为胜者,否则无法比较。

比较水的题目,求和然后比较大小即可,需要注意每场得分的顺序是有一个调换的。

AC代码

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{int p,s,p1,p2,s1,s2;cin>>p1>>s1>>s2>>p2;p=p1+p2;s=s1+s2;if(p>s)cout<<"Persepolis"<<endl;else if(s>p)cout<<"Esteghlal"<<endl;else {if(s1>p2)cout<<"Esteghlal"<<endl;else if(p2>s1)cout<<"Persepolis"<<endl;elsecout<<"Penalty"<<endl;}return 0;
}

Iranian ChamPions Cup 水题相关推荐

  1. 伊朗 2018 ICPC区域赛 A : Iranian ChamPions Cup

    题目描述 The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its ...

  2. 【思维】Iranian ChamPions Cup

    题目描述 The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its ...

  3. PAT甲题题解-1011. World Cup Betting (20)-误导人的水题。。。

    题目不严谨啊啊啊啊 式子算出来结果是37.975 样例输出的是37.98 我以为是四舍五入的啊啊啊,所以最后输出的是sum+0.005 结果告诉我全部错误啊 结果直接保留两位小数就可以了啊啊啊啊 水题 ...

  4. CodeForces Canada Cup 2016 A、B水题 _(:з」∠)_

    哭哭哭哭哭哭哭 又降了4...... 这次吸取的教训是...本来就是个做题慢的傻逼....一定要准时题目一开就开始做.....不然就等着降名次吧,..... 开始四十多分钟才开进去的.....再给我四 ...

  5. 水题/poj 1852 Ants

    1 /* 2 PROBLEM:poj1852 3 AUTHER:Nicole 4 MEMO:水题 5 */ 6 #include<cstdio> 7 using namespace std ...

  6. HDU2673-shǎ崽(水题)

    如果不能够直接秒杀的题,就不算水题.又应证了那句话,有时候,如果在水题上卡住,那么此题对于你来说,也就不算是水题了额~~ 刚睡醒,迷迷糊糊. 题目的意思很简单,求一个最大的,再求一个最小的.几乎是什么 ...

  7. 图论刷水题记录(二)(最短路-----SPFA算法)

    继第一篇的后续,又来刷水题了,写的是SPFA算法,这个算法的复杂度比较玄学,感觉能不用就不用了,但是他的好处就是可以判断负圈. 3月26日: 1.POJ 1847 Tram 题意:在一个交通网络上有N ...

  8. 图论刷水题记录(一)(最短路-----dijkstra算法)

    最近实在不知道干些什么,感觉自己除了水题什么都不会做,算了去刷一刷图论的水题吧本来想合起来一起发,想了想太长的话以后看起来也不方便,题目所以今天晚上就先发了dij部分,由上到下由易变难. 1.POJ ...

  9. hdu 2041:超级楼梯(水题,递归)

    超级楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submissio ...

最新文章

  1. P3201 [HNOI2009]梦幻布丁 [启发式合并][set]
  2. 别把机器学习和人工智能搞混了! 1
  3. vue.js下载安装教程
  4. 涡CFTurbo 10.2.6 2017泵轮涡旋式机械设计
  5. 机械工业设计中常见三维软件大盘点
  6. json几种不同解析方式
  7. 计算机公式算加减乘除教程视频,Excel快速计算加减乘除教程 Excel表格公式计算方法...
  8. 配置Jinjia2模板引擎
  9. 结束 oracle 锁 ps -ef|grepp.spid,oracle 解锁表剔除去session 和kill
  10. 【2019保研经验】清华贵系、清华软院、北大叉院、中科院自动化所等
  11. HTML重点知识小结①
  12. NEON----ARM通用 SIMD 引擎
  13. 《freemind中文教程》笔记
  14. 帝国CMS仿hao123漫画网站模板动态版
  15. python 06 基本数据类型 tuple
  16. 猪八戒网冲刺港交所上市:2021年GMV达84亿元,朱明跃持股28%
  17. MFC使用第三方CSpreadSheet
  18. Chrome23下支付宝无法安装安全控件解决方法
  19. 补齐 windows 运行库和运行环境(VC++、DirectX、.Net)
  20. 长沙学院计算机科学与技术排名,长沙学院计算机科学与技术系

热门文章

  1. storyboard之 Segue
  2. 【c语言】用指针变量输出一维数组中的数据
  3. 求01矩阵中的最大的正方形面积
  4. python 解析json typeerror_TypeError:在使用Python解析JSON时,字符串索引必须是整数?...
  5. Maven安装教程详解与导入
  6. 设计模式(十五)——桥接模式
  7. bzoj2208:[Jsoi2010]连通数
  8. android的listview+BaseAdapter的例子
  9. drupal ajax json异步调用
  10. [HttpPost] vs [AcceptVerbs(HttpVerbs.Post)]