|
|
back to boardwhy wrong at test3?c++ 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=enHow 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. |
|
|