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 1502. Domino Dots

What's wrong here?
Posted by Xysia 28 Jan 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.
Re: What's wrong here?
Posted by Sina Karimi 20 Feb 2010 20:12
For The First Code :
Add using namespace std; for using cin & cout.