题目不太好懂,看了别人的翻译。大概意思就是,球形表面积增加量比上原表面积,其实就是n/4*100%
题目:
Problem H
The Land of Justice
Input: standard input
Output: standard output
Time Limit: 4 seconds
In the Land of Justice theselling price of everything is fixed all over the country. Nobody can buy a thingand sell it in double price. But, that created problems for the businessmen.They left their business and went to the production. So, after some dayseverybody was in production and nobody in business. And the people didn’t gettheir necessary things though the country was self-sufficient in every sector.
The government became very muchanxious. But, they were intelligent enough to call the mathematicians.
The mathematicians gave asolution. They suggested setting thesurface area of an object as its selling-unit instead of its volume. Actuallythe clever mathematicians were very much interested to establish their ownbusiness.
Now, the government asks theprogrammers to build the software that would calculate the profit things.
Here your job is to calculate thebusiness profit for a solid sphere. A businessman buys a complete sphere and tomaximize his profit he divides it in n equal parts. All cut should gothrough the axis of the sphere. And every part should look like the picturebelow:
Input
You are given a sequence ofintegers N (0 < N < 231), indicating the numbers of parts ofthe sphere. The input file is terminated with a negative number. This numbershould not be processed.
Output
Calculate the profit over the sold pieces. The resultshould be in percentage and rounded to the nearest integer.
Sample input
2
2
-1
Sampleoutput
50%
50%
Problemsetter: TazrianKhan, University of Dhaka
解答:
#include<stdio.h>
int main()
{
int t;
while(scanf("%d",&t)!=EOF)
{
if(t<0)
break;
else if(t<=1)
printf("%d%%\n",0);
else
printf("%.0lf%%\n",(double)25*t);
}
return 0;
}