CrazyDiver

Cycles/Write even nums[B]

Dec 12th, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.39 KB | None | 0 0
  1. function InptPlus2(inpt:integer):integer;
  2. begin
  3.   InptPlus2:=inpt+2;            //add to input value 2
  4. end;
  5. var n,i,outp:integer;
  6. begin
  7.   read(n);                      //read input
  8.   outp:=0;              
  9.   for i:=1 to n do              //repeat loop n times
  10.     begin
  11.       outp:=InptPlus2(outp);    //add to value 2
  12.       write(outp,' ');          //write output in line
  13.     end;
  14. end.
Add Comment
Please, Sign In to add comment