(*Cathy Ngai F.4AS(24) *)
(*the purpose of this program is to read a name conmsisting a surname and a first name, and then prints the initials,each followed by a full stop *)

Program extract_name;
uses wincrt;
var s,name1,name2,name3:string;
    i,j:integer;
begin

      Write('Enter a name of 3 words ');
      Readln(s);
      i:=1;


           repeat
             name1:=name1+s[i];
             i:=i+1;
           until s[i]=' ';
           i:=i+1;

           repeat
             name2:=name2+s[i];
             i:=i+1;
           until s[i]=' ';
           i:=i+1;

           repeat
             name3:=name3+s[i];
             i:=i+1;
           until i=length(s)+1;


       writeln('The 3 words are ');

       writeln(name1);
       writeln(name2);
       writeln(name3);

end.

    Source: geocities.com/hk/cathy_740

               ( geocities.com/hk)