ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1084. Пусти козла в огород

!!!! MESSAGE FOR THE ADMINISTRATORS !!!!
Послано Manastireanu 9 апр 2005 14:24
//There seams to be a problem with your C++ compiler.
//It doesn't support #include<math.h>
//In many problems I tried to use MATH.H, but I always got //COMPILATION ERROR.
//Please take my notice into consideration and fix, if //possible, the problem.

Thank you.
I solved the problem. :D
Look at my other post to see the solution. :D

Edited by author 09.04.2005 15:27


Edited by author 10.04.2005 17:21
READ FAQ! (+)
Послано Victor Barinov (TNU) 9 апр 2005 14:56
You got CE, because, maybe your code have the next lines:

#include <math.h>
...
int n;
...
sqrt(n);
...

if you change
sqrt(n);
to
sqrt((double)n);

You will not get CE!

Sorry for my poor English :)
Re: READ FAQ! (+)
Послано Manastireanu 9 апр 2005 15:26
I don't have any integer variables. (int n)
I use float.
float n;
sqrt(n);
I tried also with double n; but I still get compilation error.
Write me letter... (+)
Послано Victor Barinov (TNU) 9 апр 2005 19:05
Send me your source to victorbarinov@ua.fm
If you know Russian language, say please. Bue!
Re: Write me letter... (+)
Послано Manastireanu 10 апр 2005 14:25
I sent you an email containing my code.
Please take a look.
I'm sorry but I don't know Russian.
My email is danmana11@yahoo.com
I sent the answer to You. (+)
Послано Victor Barinov (TNU) 10 апр 2005 16:34
If you not recieve my letter...

change  sqrt(2)  to  sqrt(2.0)

in C

2 - integer value
2.0 - double value
Re: I sent the answer to You. (+)
Послано Manastireanu 10 апр 2005 17:13
Thank you very much I got AC.
I was able to get AC other problems in witch I had the same error.
I also got AC with the same code, but in C (with sqrt(2)).

It seams that only C++ has this problem.

So my conclusion :
in C++ use sqrt(2.0); //sqrt(2); produces CE
in C it is ok to use sqrt(2);

Thank you very much for your help.  :D