1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| #include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
#include "locale.h"
int gl(char ch);
int main()
{ char a;
setlocale(LC_ALL, "rus");
printf("Введите букву\n");
scanf_s("%c", &a);
if (gl(a)==1)
printf("Гласная", a);
else
printf("Не гласная", a);
printf("%c", gl(a));
system("pause");
}
int gl(char ch)
{ char m[18]={'У', 'Е', 'А', 'О', 'Э',
'Я', 'И', 'Ю', 'Ё',
'у', 'е', 'а', 'о', 'э', 'я', 'и', 'ю', 'ё'};
int N=0;
setlocale(LC_ALL, "rus");
for (int i=0; i<18; i++)
if (m[i]==ch) N++;
if (N==1)
return 1;
else return 0;
} |