|
|
вернуться в форумWhy wrong answer? #include<stdio.h> #include<math.h> int main() { int N,i,sum; scanf("%d",&N); if(abs(N)<= 10000){ if(N > 0){ sum = (N * (N + 1))/2; } else if(N < 0) { sum = ((abs(N)+2) * (N + 1))/2; } printf("%d",sum); } return 0; } Edited by author 19.06.2018 15:45 Edited by author 19.06.2018 15:45 |
|
|