Advertisement
Josif_tepe

Untitled

May 7th, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void slozenost(int a) {
  6.    for (int i = 2; i <= a-1; i += 1)
  7.    {
  8.        if (a % i == 0)
  9.        {
  10.            cout << "Slozen" << endl;
  11.            return;
  12.        }
  13.    }
  14.    cout << "Prost" << endl;
  15. }
  16.  
  17. int main()
  18. {
  19.     int a;
  20.     cin >> a;
  21.     slozenost(a);
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement