Advertisement
GlitchyTech

2.4.7. : fill_file

Dec 19th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.42 KB | None | 0 0
  1. program hash;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. {$R *.res}
  6.  
  7. uses
  8.   System.SysUtils;
  9.  
  10. var
  11.   f : text;
  12.   fileName, s: string;
  13.   n, i : integer;
  14.  
  15. begin
  16.   fileName := 'data.txt';
  17.   assign(f, fileName);
  18.   rewrite(f);
  19.  
  20.   write('Write down number of objects : ');
  21.   readln(n);
  22.   writeln('<name> <word> <number_of_words>');
  23.  
  24.   for i := 1 to n do
  25.   begin
  26.     readln(s);
  27.     writeln(f, s);
  28.   end;
  29.  
  30.   close(f);
  31.   readln;
  32.  
  33. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement