Ural 1001 Reverse Root 解题报告
题意:
求出每个数的平方根,然后倒序输出。保留四位小数。
思路:
我在Ural的第二道题,我的第一篇ural解题报告,为什么第一道题没有写呢。。。。你们懂的。之所以选择Ural,是因为那上面的题都是原创的,质量很高,有很多国内的童鞋也在那里A题。。。我就是想找一个安静的环境不断的A题,所以就选择了这个oj了。
代码:
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
usingnamespace std;
double d[1000003];
int main()
{
//freopen("input.txt","r",stdin);
int i=0;
while(cin>>d[++i]);
for(int j=i-1;j>0;j--)
{
cout<<setprecision(4)<<setiosflags(ios::fixed| ios::showpoint)<<sqrt(d[j])<<endl;
}
return0;
}
#include <cstdio>
#include <iomanip>
#include <cmath>
usingnamespace std;
double d[1000003];
int main()
{
//freopen("input.txt","r",stdin);
int i=0;
while(cin>>d[++i]);
for(int j=i-1;j>0;j--)
{
cout<<setprecision(4)<<setiosflags(ios::fixed| ios::showpoint)<<sqrt(d[j])<<endl;
}
return0;
}