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

why wrong at test3?c++
Posted by Boqian Jiang 2 Feb 2010 09:44
i run it and i see there's no differernce between mine and the accepted one in result.

#include <cstdlib>
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[])
{
   int a=0;
   double b[1000];

   do{
          cin>>b[a];
    b[a]=sqrt(b[a]);
    a++;}
   while (!cin.eof());


   a=a-2;

   while (a>=0)
   {
   cout<<setiosflags(ios::fixed)<<setprecision(4);
   cout<<b[a]<<endl;
   a--;
}

          system("PAUSE");
    return EXIT_SUCCESS;
    }
Re: why wrong at test3?c++
Posted by cNoNim 10 Feb 2010 03:48
http://acm.timus.ru/help.aspx?topic=faq&locale=en
How to read and write data?
Programs should read and write data using standard input and output, i.e. should read from the keyboard and write to the screen. Programs must not work with files, it may cause “Restricted function” verdict. You should not add statements like Readln or !!!pause()!!! to the end of your programs. Such things may cause “Time limit exceeded” verdict.