Autor Wiadomość
Siwy
PostWysłany: Wto 12:46, 04 Mar 2008    Temat postu:

a ma ktos te zadania o rekordach ?
stramik
PostWysłany: Nie 12:15, 24 Lut 2008    Temat postu: lab1 - trawka

Kod:

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  StrUtils;

var
i,p,k:integer;
s:string;
begin
writeln('Wprowadz zdanie');
readln(s);
p:=0;
k:=0;
for i:=1 to length(s)+1 do
begin
   if p=0 then
   begin
      if s[i] in ['a'..'z','A'..'Z'] then
      begin
      p:=i;
      end;
   end;

   if (k=0)  and (p>0) then
   begin
      if not(s[i] in ['a'..'z','A'..'Z']) then
      begin
      k:=i-1;
      end;
   end;

        if (p>0) and (k>0) then
        begin
        writeln(midstr(s,p,k-p+1));
        p:=0;
        k:=0;
        end;
end;

readln;

  { TODO -oUser -cConsole Main : Insert code here }
end.

Powered by phpBB © 2001, 2005 phpBB Group