Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9-pu2rile #29

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/29#issue-2320060288)
>>>>>>> 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");
}