UVa 10499 The Land of Justice
解題策略
有關圓形體積的小題目,稍微推導一下即可。注意
n == 1 是特例要處理。變數記得開long long。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
} |
留言
張貼留言