Skip to content

Commit

Permalink
2024-05-27 오늘도 졌다
Browse files Browse the repository at this point in the history
  • Loading branch information
pu2rile committed May 28, 2024
1 parent 7d7e5c3 commit d2be143
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pu2rile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
| 2차시 | 2024.03.29 | 구현 | [OX퀴즈](https://www.acmicpc.net/problem/8958) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/6#issue-2214931034)|
| 3차시 | 2024.04.02 | 문자열 | [크로아티아 알파벳](https://www.acmicpc.net/problem/8958) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/10#issue-2220631332)
| 4차시 | 2024.04.08 | 스택 | [제로](https://www.acmicpc.net/problem/10773) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/15#issue-2229909173)
<<<<<<< Updated upstream
=======
| 5차시 | 2024.04.10 | 그리디 알고리즘 | [국회의원 선거](https://www.acmicpc.net/problem/1417) | [#18](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/18#issue-2235862658)
| 6차시 | 2024.05.10 | 그리디 알고리즘 | [ATM](https://www.acmicpc.net/problem/11399) | [#25](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/25#issue-2289086909)
| 7차시 | 2024.05.10 | 완전 탐색 알고리즘 | [영화감독 숌](https://www.acmicpc.net/problem/1436) | [#26](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/25#issue-2289086909)
| 8차시 | 2024.05.14 | 그리디 알고리즘 | [](https://www.acmicpc.net/problem/1105) | [#28](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/28#issue-2295901384)
| 9차시 | 2024.05.27 | 구현 | [오늘도 졌다](https://www.acmicpc.net/problem/14582) | [#29]()
>>>>>>> Stashed changes
27 changes: 27 additions & 0 deletions pu2rile/구현/오늘도 졌다.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <stdio.h>

int main() {
int j[9];
int g[9];
int win = 0;
int j_score = 0;
int g_score = 0;

for (int i=0 ; i<9; i++) { //제미니스 점수 입력
scanf("%d", &j[i]);
}
for (int i=0 ; i<9; i++) { //걸리버스 점수 입력
scanf("%d", &g[i]);
}

for (int i=0 ; i<9; i++) {
j_score += j[i]; //제미니스 점수 누적합(j_score == 총 점수)
if (j_score > g_score) //점수 비교
win = 1; //제미니스가 이겼다면 win = 1
g_score += g[i]; //걸리버스 점수 누적합(g_score == 총 점수)
}
if (j_score < g_score && win == 1) //제미니스가 졌지만 제미니스가 이긴 적이 있다면(역전패)
printf("Yes\n");
else
printf("No\n");
}

0 comments on commit d2be143

Please sign in to comment.