fork(1) download
  1. Program test (input, output);
  2. var
  3. S, I, N : integer;
  4. begin
  5. write ('Введіть N: ');
  6. readln (N);
  7. S :=0;
  8. For I :=1 To N Do
  9. begin
  10. if i mod 2=0 then
  11. begin
  12. S :=S+I;
  13. writeln ('Поточне значення I=',I,' S=',S);
  14. End;
  15. End;
  16. writeln ('Фінальний результат Сума S=', S);
  17. end.
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Введіть N: Фінальний результат Сума S=0