Предмет: Информатика,
автор: igrendelaross
Возраст
Маленькому
марсианину Коляйно известны возраст папы и возраст мамы. Он хочет узнать, кто
из них старше, но никак не может разобраться. Помогите ему в этом.
Input
Со стандартного
устройства ввода вводится через пробел 2 целых положительных числа, не
превосходящих 10000 – возраст папы и возраст мамы Коляйно.
Output
Нужно выдать на
стандартное устройство вывода одно из следующих сообщений:
“Mother is older than father” – если мама старше папы
“Mother is younger than father” – если папа старше мамы
“Mother and father are of the same
age” – если папа и
мама ровесники
Кавычки
выводить не нужно.
Sample
Input
1234 4321
Sample
Output
Mother is older than father
Ответы
Автор ответа:
0
Написано на Pascal.
Program ParentsAge;
Var a, b: Integer;
Begin
Read(a);
Read(b);
If (a > 10000) Or (b > 10000) Then
WriteLn('Error! Age is bigger then 10000')
Else
Begin
If(aWriteLn('Mother is older than father')
Else if(a>b) Then
WriteLn('Mother is younger than father')
Else
Writeln('Mother and father are the same age');
End;
ReadLn;
End.
Program ParentsAge;
Var a, b: Integer;
Begin
Read(a);
Read(b);
If (a > 10000) Or (b > 10000) Then
WriteLn('Error! Age is bigger then 10000')
Else
Begin
If(aWriteLn('Mother is older than father')
Else if(a>b) Then
WriteLn('Mother is younger than father')
Else
Writeln('Mother and father are the same age');
End;
ReadLn;
End.
Похожие вопросы