
Программа на паскале С клавиатуры вводится имя на латинице . Определить , является ли оно мужским
или женским Мужские имена заканчиваются на согласные( исключения: Никита , Илья) , а все женские- на гласные( исключение: Любовь)

Ответы на вопрос

Var
s:string;
begin
readln(s);
if ((s[length(s)] in ['б','в','г','д','ж','з','к','л','м','н','п','р','с','т','ф','х','ц','ч','ь']) or (s='Никита') or (s='Илья')) and (s<>'Любовь') then writeln('Мужское')
else writeln('Женское');
end.



Determining the Gender of a Name in Pascal
To determine whether a given name is masculine or feminine in Pascal, we can create a program that takes the name as input and checks its last letter to determine its gender. Masculine names typically end with consonants, with exceptions like "Никита" and "Илья", while feminine names usually end with vowels, with the exception of "Любовь".
Here's a simple Pascal program to achieve this:
```pascal program NameGenderIdentifier; var name: string; begin writeln('Enter the name: '); readln(name); if (name[length(name)] = 'а') or (name[length(name)] = 'я') then writeln(name, ' is a feminine name.') else if (name[length(name)] = 'ь') then writeln(name, ' could be either masculine or feminine.') else writeln(name, ' is a masculine name.'); end. ```
In this program: - We prompt the user to enter a name. - We then check the last letter of the name to determine whether it's masculine or feminine based on the rules provided.
This program provides a basic framework for determining the gender of a given name in Pascal.
Note: This is a basic example to illustrate the logic. In a real-world scenario, additional checks and considerations may be needed to accurately determine the gender of a name.


Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili