-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuva492.cpp
99 lines (89 loc) · 1.97 KB
/
uva492.cpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using namespace std;
#include<iostream>
#include<cstdio>
#include<cstring>
#include<ctype.h>
bool vowel(char c)
{
if(c=='a'||c=='A'||c=='e'||c=='E'||c=='i'||c=='I'||c=='o'||c=='O'||c=='u'||c=='U')
return true;
return false;
}
int main()
{
char c,ch;
while(scanf("%c",&c)==1)
{
if(isalpha(c))
{
if(vowel(c))
{
while(isalpha(c))
{
printf("%c",c);
scanf("%c",&c);
}
printf("ay");
}
else
{
ch=c;
c=getchar();
while(isalpha(c))
{
printf("%c",c);
scanf("%c",&c);
}
printf("%cay",ch);
}
}
printf("%c",c);
}
return 0;
}
/* while(gets(str))
{
int l=strlen(str);
int i=0,flag=0;
while(i<l)
{
if(vowel(str[i]))
{
while(i<l&&str[i]!=' ')
{
if(str[i]=='.')
{
flag=1;
}
else
cout<<str[i];
i++;
}
cout<<"ay";//<<str[i];
if(i<l)
cout<<" ";
i++;
}
else
{
c=str[i];
i++;
while(i<l&&str[i]!=' ')
{
if(str[i]=='.')
{
flag=1;
}
else
cout<<str[i];
i++;
}
cout<<c<<"ay";//<<str[i];
if(i<l)
cout<<" ";
i++;
}
}
if(flag)
cout<<".";
cout<<endl;*/