백준 알고리즘/구현85 백준 1929번 import mathdef isPrime(num): if num 2018. 9. 11. 백준 2581 a = int(input())b= int(input())min=0sum=0key=0for i in range(a,b+1): flag=0 if i > 2: for j in range(2,i): if i%j==0: flag=1 if flag==0: sum=sum+i if key==0: min=i if i ==2: sum=sum+2 if key==0: min=i if min!=0: key=1if min==0: print(-1)else: print(sum) print(min) 2018. 9. 11. 백준 1978 n = int(input())count=0a= list(map(int, input().split()))for i in range(len(a)): flag=0 if a[i] > 2: for j in range(2,a[i]): if a[i]%j==0: flag=1 if flag==0: count+=1 if a[i] ==2: count+=1print(count) 2018. 9. 11. 백준 2751번 n = int(input())a=[0]*nfor i in range(n): a[i]= int(input())a.sort()for i in range(len(a)-1): if a[i] == a[i+1]: a.remove(i+1)for i in range(len(a)): print(a[i]) 2018. 9. 11. 이전 1 ··· 18 19 20 21 22 다음