GamerSK

Sucet párnych čísiel

Jan 23rd, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.44 KB | None | 0 0
  1. program sucetparnych;
  2. {$APPTYPE CONSOLE}
  3. uses SysUtils;
  4. var n,i,c,pc,v:byte;
  5. begin
  6.   { TODO -oUser -cConsole Main : Insert code here }
  7.   write('Kolko cisiel chcete zadat?: ');
  8.   readln(n);
  9.   v:=0;
  10.   pc:=0;
  11.   for i:=1 to n do
  12.     begin
  13.       write('Zadajte cislo: ');
  14.       readln(c);
  15.       if c mod 2 = 0 then
  16.         begin
  17.           pc:=c;
  18.           v:=v+pc;
  19.         end;
  20.       end;
  21.     writeln('Vysledok: ',v);
  22.     readln;
  23. end.
Advertisement
Add Comment
Please, Sign In to add comment