-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2002j2.c
More file actions
25 lines (25 loc) · 770 Bytes
/
2002j2.c
File metadata and controls
25 lines (25 loc) · 770 Bytes
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
#include <stdio.h>
#include <string.h>
int main(){
char str[68];
puts("Enter words to be translated:");
while(1){
fgets(str,68,stdin);
strtok(str,"\n");
if(strcmp(str,"quit!")==0){
return 0;
}
if(strlen(str)>4){
if(strcmp(str+strlen(str)-2,"or")==0){
if((str[strlen(str)-3]!='a')&&(str[strlen(str)-3]!='e')&&(str[strlen(str)-3]!='i')&&(str[strlen(str)-3]!='o')&&(str[strlen(str)-3]!='u')&&(str[strlen(str)-3]!='y')){
str[strlen(str)-1]='u';
str[strlen(str)]='r';
str[strlen(str)+1]='\n';
puts(str);
continue;
}
}
}
puts(str);
}
}