import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); float h=scanner.nextFloat(); int n =scanner.nextInt(); //write your code here...... float distance=h; while(--n>0){ distance+=h; h/=2; } //输出格式为:System.out.println(String.format("%.3f", h)+" "+String.format("%.3f", sum)); System.out.println(String.format("%.3f",h/2)+" "+String.format("%.3f",distance)); } }