-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} |