📄 1242.cpp
字号:
#include<cstdio>
#include<cmath>
int main()
{
//freopen("in.txt","r",stdin);
int w,d;
int line=0;
long long int age=0;
while(scanf("%d %d",&w,&d) && w && d)
{
line++;
double temp =log2(810*w*1.0/d);
temp *=5730;
if(temp < 10000) age=int(temp/100+0.5)*100;
else if( temp > 10000) age=int(temp/1000+0.5)*1000;
//if(line>1) printf("\n");
printf("Sample #%d\nThe approximate age is %lld years.\n\n",line,age);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -