/*VS C++*/
#include
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
int N, y, i;
bool Prime;
cout << "Введите число: "; cin >> N;
do {
Prime = true;
y = N % 10;
for (i = 2; i <= (sqrt(abs(y))); i++) {<br> if (y % i == 0) {
Prime = false;
break;
}
}
if ((Prime) & (y != 0) & (y != 1))
cout << y << " - простое" << endl;<br> else
cout << y << " - не простое" << endl;<br> N = N / 10;
} while (N != 0);
system("pause");
return 0;
}