
Сообщение от
CilCatblack
Есть строка char(англ. буквы) вводится с клавиатуры.
Как вывести на экран слова начинающиеся с гласной буквы:huh::(
Please Heeelp!!! Пример если можно!:huh:
Сессия!!!:(
Что-то вроде этого. Программа кстати несложная.
C |
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
30
31
32
| #include<stdio.h>
#include<conio.h>
#include<ctype.h>
#define MAX 100
void main()
{
char text[MAX], ch;
int index=0;
clrscr();
puts("Input the text: ");
fgets(text, MAX, stdin);
puts("\nWords, begining from the vowel letters:\n");
while(text[index]!='\0')
{
while(text[index]==32||text[index]==9)
index++;
ch=toupper(text[index]);
if(ch==65||ch==69||ch==73||ch==79||ch==85||ch==89)
{
while(text[index]!=32&&text[index]!=0&&text[index]!=9)
{
putchar(text[index]);
index++;
}
printf("\n");
}
else
while(text[index]!=32&&text[index]!=0&&text[index]!=9)
index++;
}
getch();
} |
|