Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- using namespace std;
- void main()
- {
- int a, s, n, k;
- setlocale(LC_ALL, "Russian"); //чтобы появился русский текст в консоли
- cin >> a;
- k = 0;
- for (int s = 0, n = 2; n < a; n++)
- {
- if (a % n == 0)
- {
- s = 1; k = s; break;
- }
- }
- if (k == 0)
- cout << "Число простое" << endl;
- else cout << "Число составное" << endl;
- cin.get();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement