Тефтерче с телефони

Напишете програма, която да ви служи като тефтерче с телефони на познати:

  • можете да запишете имената и телефоните на ваши познати във файл
  • можете да ги прочетете от файла и да ги изведете на екрана
Публикувано в 10a с етикети . Постоянна връзка.

One Response to Тефтерче с телефони

  1. Боряна каза:
    program tefter;
    procedure Zapis;
    var
      ime, tel: string;
      F: text;
    begin
      Assign(F, 'tefter.txt');
      Rewrite(F);
      WriteLn('Vavejdaite posledovatelno imena i telefoni, po edno na red:');
      repeat
        ReadLn(ime);
        if ime<>'' then begin
          WriteLn(F, ime);
          ReadLn(tel);
          WriteLn(F, tel);
        end;
      until ime='';
      Close(F);
    end;
    procedure Chetene;
    var
      ime, tel: string;
      F: text;
    begin
      Assign(F, 'tefter.txt');
      Reset(F);
      WriteLn('Vashiat tefter sadarga:');
      while not EOF(F) do begin
        ReadLn(F, ime);
        Writeln(ime);
        ReadLn(F, tel);
        WriteLn(tel);
      end;
      Close(F);
    end;
    
    begin
      Zapis;
      Chetene;
      ReadLn;
    end.
    

Вашият коментар