18 lines
233 B
C++
18 lines
233 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
|
|
// x[0]..x[99]
|
|
|
|
bool is_prime(int n) {
|
|
for (int i=2; i*i<=n; i++) {
|
|
if (n%i == 0) {return false;}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
int main() {
|
|
cout << is_prime(4);
|
|
return 0;
|
|
} |