|
|
back to boardDiscussion of Problem 1068. SumWhat's wrong? test #9 #include <iostream> int main() { double an,s; int n; std::cin>>an;
if (an>1) {n=an; s=(an+1)/2*n;} else {if (an==0) {s=1;} else {n=-(an+1); s=((an-2)/2*n);}} std::cout<<s; return 0; } |
|
|