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
>

[snip]

Do not post code. Read through the rest of the comments; your issue has been encountered before.

can somebody help meeeee??? sad.gif sick.gif
qwq

Read the rest of the comments; other people have had the same issue as you.

I tried my code for the question on my IDE and all the test cases work perfectly. However, when I submit it on the judge I get 4/5. What is wrong with my code that causes that?

I would strongly advise you to debug your own code, and if you get WA, then there is obviously something wrong with your own code

Error: Could not fin
what should i do ?


Can someone please tell me what I'm doing wrong?

Recall the definition of suffix.

ohhh thank you!

Not sure on what I am getting wrong here, can someone help

Read the question again. Your exact problem has been mentioned before in comments. In the future, please glance over them before asking again.

Note that official policy is to ignore these kinds of requests for help. You may find your questions unanswered, or vanished without a trace, if they pertain solely to a mistake you've made in your code.

OK I don't get it. I have tried this problem so many times, but it will not work even though I am sure I did it correctly. I followed all the directions :/ It would be nice if someone could help me figure out what is wrong.

Where is your loop...


Read my reply to bobbyg212009, and notice the incorrect assumption you're making with your code.

Edit: "specialties" about your code:
  • You're outputting "quit!" even though it says not to.
  • Your loop never terminates; rather, your program terminates due to an uncaught exception.

all i got is wrong after/on the second run so thats what i wanna know.so thats what i expected

Read my reply to bobbyg212009


Think carefully about your main if statement. What's wrong with it?


Read the problem statement fully next time:

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.