UVa 10499 - The Land of Justice

来源:互联网 发布:乐高nxt2.0编程软件 编辑:程序博客网 时间:2024/05/16 06:43

传送门UVa 10499 - The Land of Justice

题意是输入把一个球切成的块数, 求出表面积增加的百分比.

切成n时, 增加


化简即可.

注意n=1时的处理


PS: Actually the clever mathematicians were very much interested to establish their own business.

我怎么觉得作者在讽刺数学家...

#include <cstdio>#include <cmath>using namespace std;int main(){    double n;    while (scanf("%lf", &n) && n >= 0)    {        if (n == 1)            printf("0%%\n");        else            printf("%.f%%\n", 25 * n);    }    return 0;}


0 0
原创粉丝点击