superman

聚精会神搞建设 一心一意谋发展
posts - 190, comments - 17, trackbacks - 0, articles - 0
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

URAL 1001 - Reverse root

Posted on 2008-04-04 22:43 superman 阅读(258) 评论(0)  编辑 收藏 引用 所属分类: URAL
 1 /* Accepted 1.062 3 060 KB */
 2 #include <stack>
 3 #include <math.h>
 4 #include <iostream>
 5 
 6 using namespace std;
 7 
 8 int main()
 9 {
10     double n;
11     stack <double> set;
12     while(cin >> n)
13         set.push(n);
14     
15     cout.setf(ios_base::showpoint);
16     cout.setf(ios_base::fixed);
17     cout.precision(4);
18     
19     while(set.empty() == false)
20     {
21         cout << sqrt(set.top()) << endl;
22         set.pop();
23     }
24     
25     return 0;
26 }
27