Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { paulogp }
- { mac os 7 }
- program Ada14p;
- uses
- MemTypes, QuickDraw, OSIntf;
- var
- n, s: integer;
- fim: string;
- begin
- repeat
- clearscreen;
- writeln('Programa: Soma de números pares!');
- writeln('Paulo G.P.');
- writeln('================================');
- s:=0;
- repeat
- writeln;
- write('Introduza n numero par (ímpar para terminar): ');
- readln(n);
- if (n mod 2) = 0 then s:= s + n;
- until (n mod 2) <> 0;
- writeln;
- writeln('A soma dos números pares é ', s);
- writeln;
- writeln;
- Write('Repetir programa (S/N)? ');
- readln(fim);
- uprstring(fim, true);
- until fim = 'N';
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement