|
|
вернуться в форумwhats wrong? test # 9 #include <stdio.h> #include <math.h> #include <iostream> #include <stdlib.h> using namespace std; int main() { long int range, total = 0; cin >> range; if ( range <= 0 && abs(range) < 10000 ) { for ( int x = 1; x >= range; --x ) total += x; cout << total << endl; } else if ( range > 0 && abs(range) < 10000 ) { for ( int x = 1; x <= range; ++x ) total += x; cout << total << endl; } return 0; } Re: whats wrong? test # 9 Послано Pooria 22 ноя 2014 20:19 Edited by author 22.11.2014 20:22 |
|
|