Advertisement
Kacper_Michalak

Seria 2 Zadanie 16

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