SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <time.h>
  3. using namespace std;
  4. void main()
  5. {
  6.     int a, s, n, k;
  7.     setlocale(LC_ALL, "Russian"); //чтобы появился русский текст в консоли
  8.     cin >> a;
  9.     k = 0;
  10.     for (int s = 0, n = 2; n < a; n++)
  11.     {
  12.         if (a % n == 0)
  13.         {
  14.             s = 1; k = s; break;
  15.         }
  16.     }
  17.     if (k == 0)
  18.         cout << "Число простое" << endl;
  19.     else cout << "Число составное" << endl;
  20.     cin.get();
  21.     cin.get();
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top