#include <stdio.h> int main() { char c; int flag = 0, remove = 0, word = 0; while (scanf("%c", &c) == 1) { if (!flag) { if (isalpha(c)) { flag = 1; if (c != 'a' && c != 'A' && c != 'e' && c != 'E' && c != 'i' && c != 'I' && c != 'o' && c != 'O' && c != 'u' && c != 'U') { remove = c; continue; } else remove = 0; } } if (!isalpha(c)) { if (flag) { if (remove) putchar(remove); printf("ay"); } remove = 0; flag = 0; } putchar(c); } return 0; }
Hello, I am a CS student from Taiwan.
I am learing English and Programming.
I'll save source code of some problems or small programs without comments in this blog.
I would recommend you not to read solution from others before you solved the problem.
(這邊專門存放沒有任何註解的小程式/OJ題目程式碼)
2012年8月22日
UVa 492 - Pig-Latin
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言