Advertisement
UberKill11

Gigel

Apr 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int v[]={30, 31, 30, 31, 28, 31, 31, 30, 31, 30, 31};
  5. int main()
  6. {
  7. long long int i=0,z=0,s,m=0,o=0,nra=0,nrz=0,nrl=0,an=2002,nr=0,h=0;
  8. cin>>s; // 3888000
  9. m=s/60; // 64800
  10. o=m/60; // 1080
  11. z=o/24; // 45
  12.  
  13. while(z>=365)
  14. {
  15. if((an%4==0 && an%100!=0) || (an%400==0))
  16. {
  17. nra++;
  18. an=an-1;
  19. z=z-366;
  20. }
  21. else
  22. {
  23. nra++;
  24. an=an-1;
  25. z=z-365;
  26. }
  27. }
  28. if((an%4==0 && an%100!=0) || (an%400==0))
  29. h++;
  30.  
  31. i=-1;
  32. while(z>=31)
  33. {if(i==5 && h==1)
  34. {i++;
  35. z=z-v[i]+1;
  36. nrl++;h=0;}
  37. else
  38. {i++;
  39. z=z-v[i];
  40. nrl++;}
  41. }
  42. nrz=z;
  43. cout<<nra<<" "<<"ani"<<" ";
  44. cout<<nrl<<" "<<"luni"<<" ";
  45. cout<<nrz<<" "<<"zile"<<" ";
  46.  
  47.  
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement