|
|
back to boardCan anybody help me with WA#3 this is my code and I can't see any mistakes here..... #include <iostream> using namespace std; #include <cmath> double a[33000]; int main() { char c; __int64 N = 0,y; for(;;N++) { cin>>y; a[N] = sqrt(double(y)); c = cin.peek(); if(c == -1)break; } cout.precision(4); N--; for(;N>=0;N--) cout<<fixed<<a[N]<<endl; return 0; } Re: Can anybody help me with WA#3 Edited by author 23.03.2007 20:02 Re: Can anybody help me with WA#3 You should use while(cin >> y){...} instead of for(;;N++) { cin>>y; ...} And one more thing. Size of array should be very big, so use: #pragma comment(linker, "/STACK:16777216")//!! using namespace std; double a[100000000]; Edited by author 23.03.2007 20:05 |
|
|