#include <iostream>
using namespace std;
bool is_prime(int number) {
if (number < 2) return false;
if (number == 2) return true;
if (number % 2 == 0) return false;
for (int i = 3; (i * i) <= number; i += 2) {
if (number % i == 0) return false;
}
return true;
}
int main() {
int array[5];
int num;
cin >> num;
if (is_prime(num)) {
array[2] = num;
}
return 0;
}
Comments
Leave a comment