<swustoj>?id=46自由落体

链接http://acm.swust.edu.cn/problem/0046/

#include <stdio.h>
int main()
{
    double m;
    int n;
    double distance=0;
    scanf("%lf %d",&m,&n);
    while(n--)
    {
        distance+=m+m/2;
        m/=2;
    }
    printf("%.2lf %.2lf\n",m,distance-m);
    return 0;
}

 

posted @ 2016-07-30 10:55  艹kiss灬不离  阅读(206)  评论(0编辑  收藏  举报