1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 #include <iostream> 5 #include <vector> 6 #include <cmath> 7 using namespace std; 8 9 double a; 10 vector<double> ans; 11 12 int main() { 13 while(scanf("%lf", &a) != EOF) ans.push_back(sqrt(a)); 14 for(vector<double>::reverse_iterator it = ans.rbegin(); it != ans.rend(); ++it) 15 printf("%.4f\n", *it); 16 }
原文:http://www.cnblogs.com/oyking/p/3561245.html