Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted by kail ( 17 years ago )
Program Program_1;
Uses  CRT;
Const FileNameIn='Incoming.txt';
      FileNameOut='Outgoing.txt';
Var   F1,F2:Text;
      S,Word:string[128];
      AmountWord,i:byte;

procedure EndWord;
begin
  if Word<>'' then
    begin
      WriteLn(F2,'( ',Word,' )');
      Word:='';
      inc(AmountWord);
    end;
end;

begin
  ClrScr;
  AmountWord:=0;
  Assign(F1,FileNameIn);
  Assign(F2,FileNameOut);
  Reset(F1);
  Rewrite(F2);
  While Not SeekEoF(F1) do
    begin
      ReadLn(F1,S);
      for i:=1 to length(S) do
        if ord(s[i])=32 then EndWord else Word:=Word+S[i];
      EndWord;
    end;
   Close(F1);
  Close(F2);
  Write('V ukazannom tekstovom faile ',AmountWord,' slov.');
  Read(s);
end.

 

Revise this Paste

Your Name: Code Language: