import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); String str=sc.next(); int length=1189; int width=841; String[]s=new String [10]; for (int i = 0; i < 10; i++) { s[i]=length+"/"+width; length/=2; if(length<width){ int t=length; length=width; width=t; } } String[]nm=s[str.charAt(1)-'0'].split("/"); System.out.println(nm[0]+"\n"+nm[1]); } }
解题思路:
注意事项:
参考代码:
0.0分
6 人评分
C二级辅导-温度转换 (C语言代码)浏览:2343 |
C语言训练-谁家孩子跑最慢* (C语言代码)浏览:1508 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:619 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:770 |
C二级辅导-统计字符 (C语言代码)浏览:506 |
C语言程序设计教程(第三版)课后习题9.8 (Java代码)浏览:1640 |
【出圈】 (C语言代码)浏览:558 |
求圆的面积 (C语言代码)浏览:1271 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:572 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:513 |