Advertisement
Josif_tepe

Untitled

Nov 2nd, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main(){
  7.     int day, month, year;
  8.     cin >> day >> month >> year;
  9.     int hour, minute;
  10.     cin >> hour >> minute;
  11.    
  12.     int bd = 3, bm = 7, by = 2001;
  13.     int pd = 0, pm = 0, py = 0;
  14.     long long ph = 0, pmin = 0, ps = 0;
  15.     int meseci[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  16.    
  17.     for(int i = by; i <= year; i++) {
  18.         if((i % 400 == 0) or (i % 4 == 0 and i % 100 != 0)) {
  19.             meseci[1] = 29;
  20.         }
  21.         else {
  22.             meseci[1] = 28;
  23.         }
  24.         for(int j = 1; j <= 12; j++) {
  25.             if(i == by and j >= bm) {
  26.                 pd += meseci[j - 1];
  27.                 pm++;
  28.                 ph += (meseci[j - 1] * 24);
  29.                 pmin += (meseci[j - 1] * 24 * 60);
  30.                 ps += (meseci[j - 1] * 24 * 60 * 60);
  31.             }
  32.         }
  33.         py++;
  34.     }
  35.     return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement