program SummaAtoB
var
a, b, s, i: Integer;
begin
Write ('a, b: ');
ReadLn (a, b);
s := 0;
for i := a to b do
s := s + i;
Write ('s = ', s);
ReadLn;
end.
#include<iostream>
using namespace std;
int main()
{
int a,b,s;
cin>>a>>b;
s=0;
for(int i=a;i<=b;i++)
s=s+i;
cout<<s;
return 0;
}
program SummaAtoB
var
a, b, s, i: Integer;
begin
Write ('a, b: ');
ReadLn (a, b);
s := 0;
for i := a to b do
s := s + i;
Write ('s = ', s);
ReadLn;
end.
#include<iostream>
using namespace std;
int main()
{
int a,b,s;
cin>>a>>b;
s=0;
for(int i=a;i<=b;i++)
s=s+i;
cout<<s;
return 0;
}