UVa 10499 The Land of Justice

解題策略

有關圓形體積的小題目,稍微推導一下即可。

注意

n == 1 是特例要處理。變數記得開long long。

/**
* UVa 10499 The Land of Justice (AC)
* Author: chchwy
* Last Modified: 2009.12.07
*/
#include<iostream>
int main()
{
long long int n;
while (scanf("%lld", &n) == 1)
{
if (n < 0) break;
if (n == 1) printf("0%%\n");
else
printf("%lld%%\n", n * 25);
}
return 0;
}
view raw 10499.cpp hosted with ❤ by GitHub

留言

這個網誌中的熱門文章

UVa 10125 Sumsets

讀書心得: 撒哈拉的故事

讀書心得: 你以為你以為的就是你以為的嗎?