Programming
[백준] 2753 - 윤년 (파이썬)
[백준] 2753 - 윤년 (파이썬)
2020.04.02a = int(input()) if (a % 4 == 0 and a % 100 != 0) or (a % 400 == 0): print("1") else : print("0")
[백준] 9498 - 시험 성적 (파이썬)
[백준] 9498 - 시험 성적 (파이썬)
2020.04.02a = int(input()) if a >= 90: print("A") elif a >= 80 and a = 70 and a = 60 and a < 70: print("D") else : print("F")
[백준] 1330 - 두 수 비교하기 (파이썬)
[백준] 1330 - 두 수 비교하기 (파이썬)
2020.04.02a = input() a = a.split() num1 = int(a[0]) num2 = int(a[1]) if num1 > num2: print(">") elif num1 < num2: print("
[백준] 출력과 사칙연산 단계 (11문제) 파이썬
[백준] 출력과 사칙연산 단계 (11문제) 파이썬
2020.04.0210718 We love kriii print("강한친구 대한육군") print("강한친구 대한육군") 10171 고양이 print("\ /\\") print(" ) ( ')") print("( / )") print(" \(__)|") 10172 개 print("|\_/|") print("|q p| /}") print("( 0 )\"\"\"\\") print("|\"^\"` |") print("||_/=\\\__|") 1000 A+B a = input() temp = a.split() result = int(temp[0]) + int(temp[1]) print(result) 1001 A-B a = input() temp = a.split() result = int(temp[0]) - int(temp[1]..
[정올] 1516 : 단어 세기
[정올] 1516 : 단어 세기
2020.03.31text = [] for i in range(200): temp = input() if(temp == 'END'): break else: text.append(temp) list_count = len(text) result = [] for i in range(list_count): temp = text[i].split() result.append(temp) # print(result) w_count = {} for i in range(1): for test in result[i]: try : w_count[test] += 1 except : w_count[test] = 1 print('\n') # from collections import Counter # wordDict = Counter() # for..
[정올] 2857 : 세로읽기
[정올] 2857 : 세로읽기
2020.03.28#include #include int main() { int i,j; int max = 0; char line[5][15] = {0}; for(i = 0; i max) { max = strlen(line[i]); } } for(i = 0; i < max; i++) { for(j = 0; j < 5; j++) { if(line[j][i] == NULL) { continue; } printf("%c",line[j][i]); } } } https://github.com/kim-do-hyeon/jungol/blob/master/2857/2857.c kim-do-hyeon/jungol Contribute to kim..
[정올] 2604:그릇
[정올] 2604:그릇
2020.03.27a = input() result = list(a) list_count = len(result) height = 10 for i in range (1, list_count): if (result[i] == result[i - 1]): height += 5 elif (result[i] != result[i - 1]): height += 10 else: print("Err") print(height) https://github.com/kim-do-hyeon/jungol/blob/master/2604/2604.py kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating an account on GitHub. github.com
[정올] 2604 : 그릇
[정올] 2604 : 그릇
2020.03.27#include #include int main() { int i, height; char dish[100]; int count; scanf("%s", dish); height = 10; count = strlen(dish); for(i = 1; i < count; i++) { if(dish[i] == dish[i - 1]) { height += 5; } else { height += 10; } } printf("%d",height); return 0; } https://github.com/kim-do-hyeon/jungol/blob/master/2604/2604.c kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating..
[정올] 1314 : 문자사각형2
[정올] 1314 : 문자사각형2
2020.03.26#include void Reset(char result); int main() { int i,j; int n = 0; char arr[100][100]; scanf("%d",&n); char result = 'A'; for(i = 0; i = 0; --j) { arr[j][i] = result++; Reset(result); } } } for(i = 0; i < n; ++i) { for(j = 0; j < n; ++j) { printf("%c ",arr[i][j]); } printf("\n"..
[정올] 2814 : 이진수
[정올] 2814 : 이진수
2020.03.25num = input() if(len(num) > 30): print("err") else: print(int(num,2)) https://github.com/kim-do-hyeon/jungol/blob/master/2814/2814.py kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating an account on GitHub. github.com
[정올] 1534 : 10진수를 2,8,16진수로
[정올] 1534 : 10진수를 2,8,16진수로
2020.03.25num = input() temp = num.split(' ') value = int(temp[1]) num = int(temp[0]) if (value == 2): print(format(num, 'b')) if (value == 8): print(format(num, 'o')) if (value == 16): temp = format(num, 'x') temp = temp.upper() print(temp) https://github.com/kim-do-hyeon/jungol/blob/master/1534/1534.py kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating an account on GitHub. gi..
[정올] 1430 : 숫자의 개수
[정올] 1430 : 숫자의 개수
2020.03.25A = int(input()) B = int(input()) C = int(input()) result = A * B * C result_list = list(str(result)) for i in range(10): result_num_list = result_list.count(str(i)) print(result_num_list) https://github.com/kim-do-hyeon/jungol/blob/master/1430/1430.py kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating an account on GitHub. github.com
[정올] 2809 : 약수
[정올] 2809 : 약수
2020.03.24n = int(input()) for i in range(int(1)): d = [] for i in range(1, int(n**0.5)+1): if n%i == 0: d.append(i) if i!=n//i: d.append(n//i) sort = d.sort() print(" ".join(map(str, d))) https://github.com/kim-do-hyeon/jungol/blob/master/2809/2809_success.py
[정올] 1658 : 최대공약수와최소공배수
[정올] 1658 : 최대공약수와최소공배수
2020.03.24from math import gcd def lcm(x,y): return x * y // gcd(x,y) a = input() temp = a.split(' ') print(gcd(int(temp[0]), int(temp[1]))) print(lcm(int(temp[0]), int(temp[1]))) https://github.com/kim-do-hyeon/jungol/blob/master/1658/1658.py kim-do-hyeon/jungol Contribute to kim-do-hyeon/jungol development by creating an account on GitHub. github.com
python - 공백줄 삭제
python - 공백줄 삭제
2020.03.15print "".join([s for s in t.strip().splitlines(True) if s.strip()])