program game1;
var
  a, b, c, d : integer;

begin
     randomize;
     a := random(10);
     c := 1 ;
     d := 1 ;
     writeln('Let''s play a game ! ');
     write(d,'.Please enter 0-9 : ');
     readln(b);
     while b<>a do
           begin
                d := d + 1;
                writeln('Sorry, wrong number');
                write(d,'.Please enter 0-9 : ');
                readln(b);
                c := c + 1;
           end;
           writeln(' Yes, good try.');
     writeln('You have ', c,'trials.');
     writeln('ByeBye!');
end.
