1001. Reverse Root
Time Limit: 2.0 second
Memory Limit: 64 MB
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
input | output |
---|---|
1427 0 876652098643267843 5276538 |
2297.0716 936297014.1164 0.0000 37.7757 |
1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 #include <vector> 5 using namespace std; 6 7 int main(){ 8 9 double n; 10 vector <double> ans; 11 while(cin >> n) ans.push_back(sqrt(n)); 12 for(int i = ans.size()-1; i>= 0 ; i--) 13 printf("%.4f\n",ans[i]); 14 return 0; 15 }