반응형
https://www.acmicpc.net/problem/16727
16727번: ICPC
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 spa
www.acmicpc.net
단순 구현 문제였습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <iostream>
using namespace std;
int main() {
int a[4];
for (int i = 0; i < 4; i++)
cin >> a[i];
if (a[0] + a[3] > a[1] + a[2]) cout << "Persepolis\n";
else if (a[0] + a[3] < a[1] + a[2])cout << "Esteghlal\n";
else //각자 팀의 최종 점수가 같다면
{
//각자 팀의 away점수가 같다면
if(a[1] == a[3])
cout << "Penalty\n";
else
{
if(a[1]<a[3])
cout << "Persepolis\n";
else
cout << "Esteghlal\n";
}
}
}
|
'Algorithm > Implementation' 카테고리의 다른 글
(C++) - 백준(BOJ) 16561번 : 3의 배수 (0) | 2020.01.16 |
---|---|
(C++) - 백준(BOJ) 1018번 : 체스판 다시 칠하기 (0) | 2020.01.08 |
(C++) - 백준(BOJ) 2578번 : 빙고 (0) | 2020.01.07 |
(C++) - 백준(BOJ) 11931번 : 수 정렬하기 4 (0) | 2020.01.06 |
(C++) - 백준(BOJ) 11004번 : K번째 수 (0) | 2020.01.06 |