Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  hjhh
Language: PASCAL
Code:
program tennis;
var a, b : integer;
begin
writeln('Введите счет');
readln(a, b);
if (a>=0) and (a<21) and (b>0) and (b<21)
     then 
          if (a+b) mod 2 = 0
               then writeln('Petya serves')
               else writeln('Vasya serves')
     else 
          if a=21
               then writeln('Vasya wins')
               else 
                    if b=21 
                         then writeln('Petya wins')
                         else writeln('Счет введен неверно');
end.
          
          
Comments: