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

(C++) Why runtime error happened?
Posted by ThomasLin 6 Oct 2022 14:08
#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;

int main (){
    double Input=0 ;
    double number[] ;
    int counter=0;

    while ( cin >> Input && Input != EOF){
        number[counter] = Input;
        cout << number[counter];
        counter++ ;
    }

    for (int i=counter ; i>0; i--){
        cout << setprecision(4) << sqrt (number[counter]) << endl;
    }
}