using namespace std;
main(){
int a,b;
cin>>a>>b;
//a is left border of the sequence
//b is right border of the sequence
int result=(b*(b+1)-a*(a-1))>>1;
cout<<"The sum of sequence ["<<a<<".."<<b<<"] equals "<<result;
if(result!=100){
cout<<" and is ";
if(result>100)cout<<"greater";
else if(result<100)cout<<"less";
cout<<" than 100";
}
}
Сам не комилировал, но вроде работать должна
Сообщение отредактировал meir: 31.07.2005, 16:43:34