#include<stdio.h> int main(void){ int n; double sum,h; while (scanf("%d", &n) != EOF) { sum=h=n; //起始高度 for (int i=1; i<5;i++){ h /=2; //回去的一半 sum += h * 2; //上下 } printf("%lf\n", sum); printf("%lf\n", h/2); } }