importjava.util.Scanner;publicclassEx03_Free_Falling_Body{publicstaticvoidmain(String[] args){floatH0=120;float sum =0;Scanner sc =newScanner(System.in);int num = sc.nextInt();for(int i=0;i<num;i++){
sum = sum +H0+H0/2;H0=H0/2;}
sum = sum -H0;System.out.printf("总运动距离为:%.2fm\n",sum);System.out.printf("下次反弹高度为:%.2fm\n",H0);}}
importjava.util.Scanner;publicclassEx05_Time{publicstaticvoidmain(String[] args){Scanner sc =newScanner(System.in);int year = sc.nextInt();int month = sc.nextInt();int day = sc.nextInt();int num =0;switch(month){case1:
num = day;break;case2:
num =31+ day;break;case3:
num =31+28+ day;break;case4:
num =31+28+31+ day;break;case5:
num =31+28+31+30+ day;break;case6:
num =31+28+31+30+31+ day;break;case7:
num =31+28+31+30+31+30+ day;break;case8:
num =31+28+31+30+31+30+31+ day;break;case9:
num =31+28+31+30+31+30+31+31+ day;break;case10:
num =31+28+31+30+31+30+31+31+30+ day;break;case11:
num =31+28+31+30+31+30+31+31+30+31+ day;break;case12:
num =31+28+31+30+31+30+31+31+30+31+30+ day;break;default:break;}if((year %100!=0&& year %4==0||(year %400==0))&&(month >2))
num++;System.out.printf("你输入的是%d年%d月%d日\n", year, month, day);System.out.printf("这是%d年的第%d天\n", year, num);}}