How many prime numbers
Time Limit: 3000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 5139 accepted submission (s): 1684
Problem description
Give you a lot of positive integers, just to find out how many prime numbers there are.
Input
There are a lot of cases. in each case, there is an integer n representing the number of Integers to find. each integer won't exceed 32-bit signed integer, and each of them won't be less than 2.
Output
For each case, print the number of prime numbers you have found out.
Sample Input
32 3 4
Sample output
2
1:# Include <iostream>
2:# Include <cmath>
3:Using NamespaceSTD;
4:BoolIsprime (IntN ){
5:IntSqt = SQRT (N * 1.0 );
6:For(IntI = 2; I <= sqt; I ++)
7:If(N % I = 0)
8:Return False;
9:Return True;
10:}
11:IntMain (){
12:// Freopen ("in.txt", "r", stdin );
13:For(IntN; CIN> N ;){
14:IntNum = 0, temp;
15:While(N --){
16:Cin> temp;
17:Num + = isprime (temp );
18:}
19:Cout <num <'\ N';
20:}
21:}
determine the prime number.