Advertisement
avr39ripe

BV012LeapYearSolution

Feb 16th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.     int year{2021};
  6.     int days{365};
  7.  
  8.     std::cout << "Enter year number\n";
  9.     std::cin >> year;
  10.  
  11.     days += (year % 400 == 0) or ((year % 100 != 0) and (year % 4 == 0));
  12.  
  13.     std::cout << "In year " << year << " there are " << days << " days\n";
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement