Skip to content

Commit

Permalink
Merge pull request #29 from AlgoLeadMe/9-pu2rile
Browse files Browse the repository at this point in the history
9-pu2rile
  • Loading branch information
pu2rile authored Jul 16, 2024
2 parents 3760ce9 + 5f494ae commit 59e103d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pu2rile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
| 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)
| 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](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/29#issue-2320060288)
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 59e103d

Please sign in to comment.