fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main(){
  4. long long x,y,years,months,days;
  5. cin>>x;
  6.  
  7. years=x/365;
  8. y=x%365;
  9. months=y/30;
  10. days=y%30;
  11. cout<<years<<" years"<<endl;
  12. cout<<months<<" months"<<endl;
  13. cout<<days<<" days"<<endl;
  14.  
  15. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
258557312880 years
3 months
6 days