본문 바로가기

Programming Practice/Python103

백준 10156 파이썬 과자 K, N, M = map(int, input().split()) if (M-K*N) 2023. 9. 1.
백준 3009 파이썬 xArr = [] yArr = [] for i in range(3)://배열에 x, y 좌표 받아서 넣기 반복 3번 x, y = map(int, input().split()) xArr.append(x) yArr.append(y) for j in range(3)://x, y좌표에 각각 같은 숫자가 1개 존재하는 점 찾아서 4번째 점 좌표에 저장 if xArr.count(xArr[j]) == 1: x4 = xArr[j] if yArr.count(yArr[j]) == 1: y4 = yArr[j] print(x4, y4) 2023. 9. 1.
백준 2935 파이썬 2023. 9. 1.
백준 5717 파이썬 while True: m, f = map(int, input().split()) 1 2023. 8. 31.
백준 10757 파이썬 2023. 8. 30.
백준 2754 파이썬 학점계산 S = str(input()) if S=='A+': print('4.3') elif S=='A0': print('4.0') elif S=='A-': print('3.7') elif S=='B+': print('3.3') elif S=='B0': print('3.0') elif S=='B-': print('2.7') elif S=='C+': print('2.3') elif S=='C0': print('2.0') elif S=='C-': print('1.7') elif S=='D+': print('1.3') elif S=='D0': print('1.0') elif S=='D-': print('0.7') else: print('0.0') if-elif-else를 사용한 답 S = str(input().. 2023. 8. 30.
백준 4101 python while True: A, B = map(int, input().split()) if A>B: print("Yes") elif A==0 and B==0: break else: print("No") 또는 while True: A, B = map(int, input().split()) if A>B and (A!=0 or B!=0): print("Yes") elif A 2023. 8. 30.
백준 2480 python 주사위 세 개 A, B, C = map(int, input().split()) if A==B==C :##같은 눈 3개 print(10000+A*1000) elif A==B or A==C:##같은 눈 2개 1번 케이스 print(1000+A*100) elif B==C:##같은 눈 2개 2번 케이스 print(1000+B*100) else:##같은 눈 없을 때 print(max(A,B,C)*100)##가장 큰 수 2023. 8. 30.
백준 2675 python 문자열 반복 문자열 반복 T=int(input()) for i in range(T): R,S=map(str,input().split()) R=int(R)#R은 횟수이므로 int로 형변환 for i in range(len(S)): print(R*S[i], end='')##공백 없애주기 위해 end='' print() 2023. 8. 30.