SHARE
TWEET

Untitled

a guest Oct 21st, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uses crt;
  2. var
  3.   f1,f2 : text;
  4.   i,k : integer;
  5.  
  6. begin
  7. randomize;
  8.  
  9. assign(f1,'C:\PABCWork.NET\1.txt');
  10. rewrite(f1);
  11.  
  12. for i:=1 to 10 do
  13.  begin
  14.  k := random(2001)-1000;
  15.  writeln(f1,k);
  16.  end;
  17. close(f1);
  18.  
  19. assign(f2,'C:\PABCWork.NET\2.txt');
  20. rewrite(f2);
  21.  
  22. reset(f1);
  23.  
  24. while not eof(f1) do
  25.  begin
  26.  readln(f1,k);  
  27.  if (k>=0) and (k mod 2=0) then
  28.   begin
  29.     writeln(f2,k);
  30.   end;
  31. end;
  32.  
  33. close(f1);
  34. close(f2);
  35.  
  36. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top