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

I don't know why wrong answer ? Can you help me ? please!
Posted by QUANGPHAM 15 Aug 2018 20:34
#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;
int main(){

    unsigned long long input;
    double array[4];
    int dem = 0;

    while (dem < 4 && cin >> input ){
            array[dem] = sqrt(input);
            dem++;
    }
    for ( int i = dem - 1; i >= 0; i--)

        cout << setprecision(4) << fixed << array[i] << endl;

}
Re: I don't know why wrong answer ? Can you help me ? please!
Posted by DevZoe 23 Nov 2018 13:39
there should not have a array that with 4 length, it may have 5 or 6 or 100...echo, there is no limit