RafalSobala

zad4

Mar 20th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a,b;
  5.  
  6. int CZY_PARZYSTA(int a){
  7.     b=a%2;
  8.     if(b==0){
  9.         return 1000;
  10.     }
  11.     else{
  12.         return 2000;;
  13.     }
  14. }
  15.  
  16.  
  17.  
  18. int main()
  19. {
  20.     cout << "Podaj liczbe caΕ‚kowitΔ…: " << endl;
  21.     cin >> a;
  22.  
  23.     if(CZY_PARZYSTA(a)==1000){
  24.          cout << "Parzysta" << endl;
  25.     }
  26.     else if (CZY_PARZYSTA(a)==2000){
  27.         cout << "Nie parzysta" << endl;
  28.     }
  29.  
  30.     return 0;
  31. }
Add Comment
Please, Sign In to add comment