AmeriCanadian | 프로그래밍의 벗 PivotOJ
PivotOJ

AmeriCanadian

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2002 JuniorBOJ 6917

문제

Americans spell differently from Canadians. Americans write neighbor and color while Canadians write neighbour and colour. Write a program to help Americans translate to Canadian.

Your program should interact with the user in the following way. The user should type a word (not to exceed 64 letters) and if the word appears to use American spelling, the program should echo the Canadian spelling for the same word. If the word does not appear to use American spelling, it should be output without change. When the user types quit! the program should terminate.

The rules for detecting American spelling are quite naive: If the word has more than four letters and has a suffix consisting of a consonant followed by or, you may assume it is an American spelling, and that the equivalent Canadian spelling replaces the or by our. Note: you should treat the letter y as a vowel.

예제

예제 1

입력
color
for
taylor
quit!
출력
colour
for
taylour
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.