mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
26 lines
332 B
C
26 lines
332 B
C
|
/*
|
|||
|
<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;
|
|||
|
}
|