|
|
вернуться в форумWhat's wrong here? Послано Xysia 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. Re: What's wrong here? For The First Code : Add using namespace std; for using cin & cout. |
|
|