2002 Canadian Computing Competition, Stage 1

Problem J2: AmeriCanadian

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.

You should input 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.

Sample Input

color
for
taylor
quit!

Sample Output

colour
for
taylour

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 27, 2008

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

<
1
2
>

could somebody tell me what is wrong with my code.alll the samples work

Ok I am trying to do this problem and I have the program working but for some reasons it doesn't get accepted. I think the reasons is that I have like two outputs if the spelling is american. the first output is

"write(input[i]);"

in which all the letters except the last two are displayed and the second output is

"writeln('our');"

Does that make a difference?

No - but you're not supposed to output "quit!" :)