URAL 1001 Reverse Root(水题)

题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1001

1001. Reverse Root

Time limit: 2.0 second
Memory limit: 64 MB
The problem is so easy, that the authors were lazy to write a statement for it!

Input

The input stream contains a set of integer numbers Ai (0 ≤ Ai ≤ 1018). The numbers are separated by any number of spaces and line breaks. A size of the input stream does not exceed 256 KB.

Output

For each number Ai from the last one till the first one you should output its square root. Each square root should be printed in a separate line with at least four digits after decimal point.

Sample

inputoutput
 1427  0   

   876652098643267843 
5276538
  
   
2297.0716
936297014.1164
0.0000
37.7757
Problem Author: Prepared by Dmitry Kovalioff

贴下代码:

By LFENG
 
#include<stdio.h>
#include<math.h>
double a[1000000];
int main()
{
   
int i=0,j;
   
while(scanf("%lf",&a[i])!=EOF)
        i++;
   
for(j=i-1;j>=0;j--)
        printf(
"%.4lf\n",sqrt(a[j]));
   
return 0;
}
posted @ 2013-05-21 20:15  LFENG  阅读(309)  评论(0编辑  收藏  举报