|
|
вернуться в форумcompilation trouble Послано Woz3qK 15 янв 2007 20:53 there are no errors. why? #include <iostream.h> int main() { int i,j; cin >> i; j= abs(i)*(abs(i)+1)/2; if (i>=1) cout << j; else cout << (-j+1); } Re: compilation trouble #include <iostream> // <-- Problem was here using namespace std; // change it in your solution int main() { int i,j; cin >> i; j= abs(i)*(abs(i)+1)/2; if (i>=1) cout << j; else cout << (-j+1); } |
|
|