|
|
back to boardCommon BoardReverse Root -- C++ -- Wrong Answer Hi I am new to forum. I just tried Reverse Root problem and had judgement result as "wrong answer". Below is my code .. just wondering what is wrong with it. Because I ran it on Visual Studio and it seems to give right numbers. Many Thanks ----------------------------------------- #include <iostream> #include <iomanip> #include <cmath> int main(){ double arr[65536]; int i = 0; int value = 0; while(std::cin >> value){ arr[i++] = sqrt(static_cast<double> (value)); } std::cout<<std::setprecision(4)<<std::fixed; while(i--) std::cout << arr[i] << std::endl; } |
|
|