자료구조 & 알고리즘/프로그래머스(programmers)

CodeUp 1052~1054

CodeUp 1052 -두 정수(a, b)를 입력받아 a와 b가 서로 다르면 1을, 그렇지 않으면 0을 출력하는 프로그램을 작성해보자. a,b = input().split() if(a!=b): print(1) else: print(0) ---------------------------------------------------------------------------------------------------------------------- CodeUp 1053-1(true, 참) 또는 0(false, 거짓) 이 입력되었을 때 반대로 출력하는 프로그램을 작성해보자. a = int(input()) print(int(not bool(a))) -----------------------------------..

2020.06.16 게시됨

자료구조 & 알고리즘/프로그래머스(programmers)

CodeUp 1050~1051

Codeup 1050-두 정수(a, b)를 입력받아a와 b가 같으면 1을, 같지 않으면 0을 출력하는 프로그램을 작성해보자. a,b=input().split() if(int(a)==int(b)): print(1) elif(int(a)!=int(b)): print(0) ------------------------------------------------------------------------------ CodeUp 1051-두 정수(a, b)를 입력받아b가 a보다 크거나 같으면 1을, 그렇지 않으면 0을 출력하는 프로그램을 작성해보자. a,b=input().split() if(int(b)>=int(a)): print(1) else: print(0)

2020.06.15 게시됨