Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program q199024764;
- const N = 10;
- const a: array [1..N] of integer = (0,1,2,-3,4,5,-6,7,-8,-9);
- var i, sum: integer;
- begin
- sum := 0;
- for i := 1 to N do
- begin
- write(a[i], ' ');
- if (a[i] > 0) then sum := sum + a[i];
- end;
- writeln;
- writeln('sum = ', sum);
- end.
Advertisement
Add Comment
Please, Sign In to add comment