Вопрос школьника по предмету Информатика
Помогите написать программу в pascal.
Найдите сумму всех целых чисел [a;b]Заранее спасибо.
Ответ учителя по предмету Информатика
Var
a,b:integer;
S:real;
Begin
S:=0;
Write(‘a = ‘);
ReadLn(a);
Write(‘b = ‘);
ReadLn(b);
For b:= a to b do
S:=S+b;
WriteLn(‘S = ‘,S);
End.
Похожие вопросы от пользователей
Ex.3 Choose the appropriate verb forms to complete the sentences. 1. When Bob (was / were ) at school, he (join / joined ) Greenpeace. 2. Fortunately the smog (disappeared/ disapper ) yesterday. 3. Peter (has just eaten / ate ) a sandwich. He can’t be hungry. 4. Helen (never swam / has never swum ) in the sea. 5. Ben ( have / has ) fallen off his bike. Ex. 4. Choose the right verb forms (past simple or present perfect) to complete the sentences. 1. Ben __________ never __________to Peru. (be) 2) __________ you ________eating the salad yet? (finish) 3) Bob ____________________ a very good picture lately. (draw) 4) When my brother was a child he ________________ a lot. (draw) 5) Yesterday the boys _______________ football. (play)