שיעור 3 

program QUADRATIC;
var A, B, C, DISC:real;
begin
  readln(a);
  readln(b);
  readln(c);
  if (a=0) and (b=0)
    then writeln('The equation is degenerate.')
    else if a=0
           then writeln('The single root is ',-c/b)
           else if c=0
                  then writeln('The roots are ',-b/a,' and 0.')
                  else begin
                   disc:=sqr(b) - 4*a*c;
                   if disc > 0
                    then writeln('The roots are '
                             ,(-b+sqrt(disc))/(2*a),
                             ' and ',(-b-sqrt(disc))/(2*a))
                    else if disc=0
                          then writeln('The equal roots are',
                                    -b/(2*a))
                          else writeln('The roots are imaginary.')
                 end
end.

read(x);  N:=-1;             read(x); n:=0;
repeat                       while (x>sqr(n)) do
  n:=n+1                       n:=n+1;
until (x<=sqr(n));

atzeret:=1;                  atzeret:=1;
for i:=1 to n do             for i:=n downto 1 do
  atzeret:=atzeret*i;          atzeret:=atzeret*i;

sum:=0;                      sum:=0;  i:=1;
for i:=1 to 10 do            while i<=10 do
begin                        begin  
  read(n);                     read(n);
  sum:=sum+n                   sum:=sum+n;
end;                           i:=i+1
                             end;

read(n);  digits:=0;         for ch:='a' to 'z' do
repeat                         write(ch);
  digits:=digits+1;          for ch:='a' to 'z' do
  n:=n div 10                  write(ord(ch));
until n=0;
writeln(digits);

1> i:=1;                     2> while TRUE do  readln(n);
   while i<10 do;
     i:=2*i;                 3> k:=5;
                                repeat
4> for i:=1 to 10 do              k:=k-1;
   begin                          write(1/k)
     i:=i-1; write(i)           until k=0
   end

program DISPLAY;
var STARS, COUNT:integer;
begin
  readln(count);
  while (count <> 9999) do
  begin
    if count<=0
      then write(count:5)
      else begin
             write('     ');
             for stars:=1 to count do  write('*')
           end;
      writeln;
      read(count)
  end
end.

program CheckInput;
var N, Low, High:integer;
begin
  {$I-,R-}
  low:=3;  high:=15;
  repeat
    write(chr(7),'Please enter number [',low,' to ',high,']: ');
    readln(n)
  until (IOresult=0) and (low<=n) and (n<=high)
  {$I+,R+}
end.


program charcount;
var letcount, digcount:integer;
    ch:char;
begin
  letcount:=0;  digcount:=0;
  readln(ch);
  while (ch<>'*') do
  begin
    if ('A'<=ch) and (ch<='Z')
      then letcount:=letcount+1
      else if ('0'<=ch) and (ch<='9')
             then digcount:=digcount+1;
    readln(ch)
  end;
  writeln('There were ',letcount,' letters and ',digcount,' digits.')
end.

readln(ch);
while not (ch in ['0'..'9']) do
begin
  writeln('Error -- please enter digit.');
  readln(ch)
end;
num:=ord(ch)-ord('0');     ch:=chr(ord('A')+i-1);

program tryeoln;
var n,sum:integer;
begin
  sum:=0;
  writeln('Enter a series of numbers, then ');
  read(n);                              
  while not eoln do           while not eof do
  begin
    sum:=sum+n;
    read(n)
  end;
  readln;
  writeln('The sume is:',sum)
end.    

position:=0;
letter:=chr(null);
while not eof and (letter<>'s') do
begin 
  read(letter);
  position:=position+1
end;
if letter='s'
  then writeln('Found s at ',position:1)
  else writeln('Didn''t find any s.')