ZOJ-1242

来源:互联网 发布:centos7搭建lnmp 知乎 编辑:程序博客网 时间:2024/03/29 01:11
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));}}}}

0 0
原创粉丝点击