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

Программа на языке с++.Wrong answer ,Хотя все сходится с исходными данными и резуьтатом
Posted by Vyacheslav 19 Oct 2014 18:14
#include<iostream>
#include<math.h>
#include<iomanip>


using namespace std;
int main()
{
    double num[4];
    int a;
    for(int a(0);a<4;a++)
    cin >> num[a];
    system("cls");
    for(int a(0);a<4;a++)
    cout << num[a] << ' ';
    for(int a(3);a>=0;a--)
    {cout << "\n" << fixed << setprecision(4) << sqrt(num[a]) << endl;}
    cout << "\n";

    return 0;
}
Re: Программа на языке с++.Wrong answer ,Хотя все сходится с исходными данными и резуьтатом
Who told you that there is exactly 4 numbers in the input? For example, your code will give wrong answer on the following test:
1 2 3 4 5

Also, I'm not sure if system calls are allowed on timus.