ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

1001 solution
Posted by Levan 27 Nov 2010 12:30
Here the answer:
#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

int main(){
double x;
vector<double>a;
while(cin>>x)a.push_back(sqrt(x));

for(int i=a.size()-1;i>=0;i--)printf("%.4f\n",a[i]);
return 0;
}
Re: 1001 solution
Posted by INNOV.Team 27 Jan 2011 12:16
Didn't "while(cin>>x)" lead to endless loop?
Re: 1001 solution
Posted by shahed adnan 15 Feb 2011 20:36
it may..
while(cin>>x==1)