OJ-Problems-Source/CodeVS/1430_冰封.c

26 lines
332 B
C
Raw Normal View History

2016-07-06 14:28:18 +08:00
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:ǧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>Ŀ:p1430 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
*/
#include <stdio.h>
#include <math.h>
int isPrime(int num){
int i;
if(num == 1){
return 0;
}
for(i = 2; i <= sqrt(num); i++)
if(!(num % i))
return 0;
return 1;
}
int main(int argc, char* argv[]){
int a;
scanf("%i", &a);
printf("%s", isPrime(a) ? "\\t" : "\\n");
return 0;
}