|
|
back to boardWrong answer in c, please someone help me Posted by Sany 21 Sep 2011 10:20 # include <stdio.h> int main(){ int a; while(scanf("%d", &a)!= EOF){ int soma = 0; if((a<=10000) && (a>=-10000)){ if(a<0){ while(a<=1){ soma+= a; a++; } } else{ while(a>=1){ soma+= a; a--; } } printf("%d\n",soma); } } return (0); } |
|
|