rikardoricz

16 IF Tomasz Świątek 3BTI/2

Nov 17th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int rok;
  8.  
  9.     cout << "Podaj rok: " << endl;
  10.     cin >> rok;
  11.  
  12.     if ((rok%4==0 && rok%100!=0)||rok%400==0)
  13.     {
  14.         cout << "Rok " << rok << " jest przestepny";
  15.     }
  16.     else
  17.     {
  18.         cout << "Rok " << rok << " nie jest przestepny";
  19.     }
  20.  
  21.     return 0;
  22. }
  23.  
Add Comment
Please, Sign In to add comment