#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int num;
int x;
bool prime;
while(cin >> num){
prime = 1;
x = sqrt(num);
for ( int i = 2 ; i <= x ;i+=((i == 2)?1:2)){
if (num % i == 0){
prime = 0;
break;
}}
if (prime)
cout << "質數" ;
else
cout << "非質數" ;
}
return 0;
}
為甚麼一直TLE快瘋了