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

Обсуждение задачи 1502. Точки домино

Xysia What's wrong here? [1] // Задача 1502. Точки домино 28 янв 2008 15:02
All codes listed below works good on my computer (and they give correct answers), but when submitting I get:

Code #1:
---------------------------------------------------------
#include<stdio.h>
#include<iostream.h>

int main()
{
  long long n;
  cin>>n;

  long long wynik;
  wynik=(n*(n+1)*(n+2))/2;

  cout<<wynik<<endl;
  return 0;
}
----------------------------------------------------------
Compilation error

Code #2: removed iostream.h and replaced cin and cout with
scanf("%lld",%n); and printf("%lld\n",wynik);

WA on test 5

Code #3: same as #2, but with
printf("%0.lf\n, (double)wynik); instead

WA on test 1
-----------------------------------------------------------

All those programs work and give correct results on my computer. What's wrong here? Please help.
Sina Karimi Re: What's wrong here? // Задача 1502. Точки домино 20 фев 2010 20:12
For The First Code :
Add using namespace std; for using cin & cout.