URI 1020 Age in Days Solution in C++
URI 1020 👀 Age in Days 👀Solution in C++
URI Online Judge Solution 1020 Age in Days in C++Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
URI Online Judge Solution 1020 Age in Days in C++
#include<bits/stdc++.h>
using namespace std;
int main(){
int n ,ano, mes,dia,d;
cin>>n;
ano=n/365;
dia=n%365;
mes=dia/30;
d =dia%30;
cout<<ano<<" ano(s)"<<endl;
cout<<mes<<" mes(es)"<<endl;
cout<<d<<" dia(s)"<<endl;
return 0;}
using namespace std;
int main(){
int n ,ano, mes,dia,d;
cin>>n;
ano=n/365;
dia=n%365;
mes=dia/30;
d =dia%30;
cout<<ano<<" ano(s)"<<endl;
cout<<mes<<" mes(es)"<<endl;
cout<<d<<" dia(s)"<<endl;
return 0;}
No comments