Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 406 Bytes

1978.md

File metadata and controls

28 lines (23 loc) · 406 Bytes
description
백준 1978번

소수 찾기 - 1978

// Some code
var N = Int(readLine()!)!
var input = readLine()!.split(separator: " ").map{ Int($0)! }
var count = 0

for i in input {
    
    if i == 1 {
        count += 1
        continue
    }
    
    for j in 2..<i {
        if i % j == 0 {
            count += 1
            break
        }
    }
}
print(input.count - count)