본문 바로가기

알고리즘 문제 풀기

Codeup 1167 - 두 번째로 작은 수 http://codeup.kr/problem.php?id=1167 Codeup 1167 - 두 번째로 작은 수 xxxxxxxxxx​numbers = list(map(int, input().split()))numbers.sort()​print(numbers[1])​
Codeup 1166 - 윤년 판별 http://codeup.kr/problem.php?id=1166 Codeup 1166 - 윤년 판별 xxxxxxxxxx​year = input()year = int(year)​if(((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0)): print('yes')else: print('no')​
Codeup 1165 - 축구의 신 1 http://codeup.kr/problem.php?id=1165 Codeup 1165 - 축구의 신 1 xxxxxxxxxx​game_time, score = input().split()game_time = int(game_time)score = int(score)​if(game_time % 10 == 0): final_score = score + int((90 - game_time) / 5)else: final_score = score + int((90 - game_time) / 5) + 1​print(final_score)​
Codeup 1164 - 터널 통과하기 1 http://codeup.kr/problem.php?id=1164 Codeup 1164 - 터널 통과하기 1 xxxxxxxxxx​height_1, height_2, height_3 = input().split()height_1 = int(height_1)height_2 = int(height_2)height_3 = int(height_3)​if(height_1
Codeup 1163 - 당신의 사주를 봐 드립니다 2 http://codeup.kr/problem.php?id=1163 Codeup 1163 - 당신의 사주를 봐 드립니다 2 xxxxxxxxxx#include ​int main(void){ int year, month, day; int num;​ scanf("%d %d %d", &year, &month, &day);​ num = (year + month + day) % 1000; num = num / 100;​ if (num % 2 == 0) { printf("대박"); } else { printf("그럭저럭"); }​ return 0;}​
Codeup 1162 - 당신의 사주를 봐 드립니다 1 http://codeup.kr/problem.php?id=1162 Codeup 1162 - 당신의 사주를 봐 드립니다 1 xxxxxxxxxx#include ​int main(void){ int year, month, day; scanf("%d %d %d", &year, &month, &day);​ if ((year - month + day) % 10 == 0) { printf("대박"); } else { printf("그럭저럭"); }​ return 0;}​
Codeup 1161 - 홀수와 짝수 그리고 더하기 http://codeup.kr/problem.php?id=1161 Codeup 1161 - 홀수와 짝수 그리고 더하기 xxxxxxxxxx​num1, num2 = input().split()num1 = int(num1)num2 = int(num2)​if(num1 % 2 == 0): if(num2 % 2 == 0): print('짝수+짝수=짝수') else: print('짝수+홀수=홀수')else: if(num2 % 2 == 0): print('홀수+짝수=홀수') else: print('홀수+홀수=짝수')​
Codeup 1160 - 아르바이트 가는 날 http://codeup.kr/problem.php?id=1160 Codeup 1160 - 아르바이트 가는 날 xxxxxxxxxx​num = input()num = int(num)​if(num == 1): print('oh my god')elif(num == 3): print('oh my god')elif(num == 5): print('oh my god')elif(num == 7): print('oh my god')else: print('enjoy')​