Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstdio>
- #include<cmath>
- using namespace std;
- int main()
- {
- int year,month,days,x;
- cin>>x;
- year=x/365;
- month=(x/400)%12;
- days=(x-((year*365)+(month*30)));
- if(days==30)
- {
- days=0;
- month=1;
- cout<<year<<" ano(s)"<<endl<<month<<" mes(es)"<<endl<<days<<" dia(s)"<<endl;
- }
- else{
- cout<<year<<" ano(s)"<<endl<<month<<" mes(es)"<<endl<<days<<" dia(s)"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement