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

What is wrong ? (C++)
Posted by Bessovistnyj 7 May 2015 00:25
// ConsoleApplication4.cpp : Defines the entry point for the console application.
//
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>

using namespace std;


int main()
{
    int count = 0;
    int maxCount = 0;

    long long MyArray[255];

    for(int i=0; i<=255; i++){
        MyArray[i] = -1;
    }

    while (scanf("%llu", &MyArray[count]) != EOF){

        count++;
        maxCount = count;
        if (count > 255){
            break;
        }
    }


    for (int i = maxCount-1; i >= 0; i--){

        if(MyArray[i] !=   -1){
            long double result = 0;
            result = sqrt((long double)(MyArray[i]));
            printf("%.4Lf\n", result);
        }
    }

    system("PAUSE");
    return EXIT_SUCCESS;
}
Re: What is wrong ? (C++)
Posted by genock 7 May 2015 21:41
system("pause") must be deleted
Re: What is wrong ? (C++)
Posted by Bessovistnyj 7 May 2015 22:40
It does not work