[백준] 2753번 : 윤년 (Python) - 단계별로 풀어보기 Python3 코드 year = int(input()) if(year%4==0 and year%100!=0) or year%400==0: print("1") else: print("0") 배수가 되려면 나눴을 때 나머지가 0이 돼야 하니깐 / 가 아닌 % 를 써야함. 백준 2023.03.22
[백준] 9498번 : 시험성적 (Python) - 단계별로 풀어보기 Python3 코드 score = int(input()) if score >= 90 : #파이썬은 if문 괄호 안씀 print('A') elif score >= 80 : print('B') elif score >= 70 : print('C') elif score >= 60 : print('D') else: print('F') 백준 2023.03.22
[백준] 1330번 : 두 수 비교하기 (Python) - 단계별로 풀어보기 Python3 코드 A,B = map(int, input().split()) if(A>B): print(">") elif(A 백준 2023.03.22
[백준] 10172번 : 개 (Python) - 단계별로 풀어보기 Python3 코드 print("|\_/|") print("|q p| /}") print('( 0 )"""\\') #작은따옴표로 묶어주기 print('|"^"` |') print("||_/=\\\__|") #역슬래시 3개는 2개 출력 백준 2023.03.22
[백준] 10171번 : 고양이 (Python) - 단계별로 풀어보기 Python3 코드 print("\\ /\\ ") #역슬래시는 두개를 써야 출력된다. print(" ) ( ')") print("( / )") print(" \\(__)|") 백준 2023.03.22
[백준] 11382번 : 꼬마 정민 (Python) - 단계별로 풀어보기 Python3 코드 A,B,C = map(int, input().split()) print(A+B+C) 백준 2023.03.22
[백준] 2588번 : 곱셈 (Python) - 단계별로 풀어보기 Python3 코드 f = int(input())#first s = input()#second f2=f*int(s[2]) f1=f*int(s[1]) f0=f*int(s[0]) fxs=f*int(s) print(f2,f1,f0,fxs,sep='\n') 백준 2023.03.22
[백준] 10430번 : 나머지 (Python) - 단계별로 풀어보기 Python3 코드 A,B,C = input().split() a = int(A) b = int(B) c = int(C) print((a+b)%c) print(((a%c)+(b%c))%c) print((a*b)%c) print(((a%c)*(b%c))%c) 백준 2023.03.22
[백준] 18108번 : 1998년생인 내가 태국에서는 2541년생?! (Python) - 단계별로 풀어보기 Python3 코드 b = int(input()) #불기입력 c = b - 543 #서기연도=불기연도-543(예제확인 중요) print(int(c)) #서기출력 백준 2023.03.22