|
|
back to boardDiscussion of Problem 1068. SumHelp C++ why the compiler does not accept the job site? that do not correctly? #include <iostream> #include <math.h> using namespace std; int main() { int N; int H=0; int S=0; int i; cin>>N; if(((N<10000)&&(N>1))||((N>-10000)&&(N<-1))) { H=abs(N); for( i=2;i<=H;i++) S=S+i; if(N<0) cout<<endl<<S*(-1); else cout<<endl<<S;} else cout<<"error"; return 0; } |
|
|