#include <iostream>
using namespace std;
int main()
{
int YBorn , YNow ;
cout <<"what year where you born in?"<<endl;
cin >>YBorn;
cout <<"what year is it now?"<<endl;
cin >>YNow;
int YOld=YNow-YBorn;
cout<<"at the end of the year:"<<endl;
cout << "you're " <<YOld << " years old"<<endl;
int MOld = YOld*12;
cout<< "and "<<MOld<<" month old"<<endl;
int DOld=YNow/4-YBorn/4+YOld*365;
cout<<"and "<<DOld<<" days old"<<endl;
int HOld=DOld*24;
cout<<"and "<<HOld<<" hours old"<<endl;
int MinOld=HOld*60;
cout<<"and "<<MinOld<<" minutes old"<<endl;
int SOld=MinOld*60;
cout<<"and "<<SOld<<" seconds old"<<endl;
cout<<"and "<<SOld<<"000 miliseconds old"<<endl;
system("pause");
return 0;
}
function nmbdec(var n,osn: integer): integer;
var nmb,l,s,k: integer;
begin
nmb:=0; s:=0;
k:=n; l:=1;
while k>0 do
begin
s:=k mod 10;
k:=k div 10;
nmb:=nmb+l*s;
l:=l*osn;
end;
Result:=nmb;
end;
{ конец функции}
begin
write('число: ');
readln(n);
write('квадрат какого числа: ');
readln(m);
osn:=10;
while osn>=2 do
begin
osn:=osn-1;
if nmbdec(n,osn)=sqr(nmbdec(m,osn)) then
begin
writeln('основание системы = ',osn);
break;
end;
end;
end.