import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int i = 0;
while (true)
{
int a = sc.nextInt();
int b = sc.nextInt();
if (a == 0 && b == 0)
break;
double r = 5730 * Math.log(810.0 * a / b) / Math.log(2);
System.out.format("Sample #%d\n", ++i);
if (r < 10000)
{
System.out.format("The approximate age is %d years.\n\n", 100 * Math.round(r / 100));
}
else
{
System.out.format("The approximate age is %d years.\n\n", 1000 * Math.round(r / 1000));
}
}
}
}
ZOJ-1242
最新推荐文章于 2017-01-19 07:52:55 发布