|
|
вернуться в форумwhy wrong answer on test case #2 ? #include<stdio.h> int main() { int n, sum=0, i; scanf("%d", &n); if(n>0) { for(i=1; i<=n; i++) sum=sum+i; } else if(n<0) { for(i=n; i<=1; i++) sum=sum+i; } printf("%d", sum); return 0; } Re: why wrong answer on test case #2 ? Послано decay 9 ноя 2018 15:02 What if N = 0? Re: why wrong answer on test case #2 ? thank you sir. |
|
|