## CCC '02 J2 - AmeriCanadian

View as PDF

Points:3
Time limit:2.0s
Memory limit:64M

Problem type

##### Canadian Computing Competition: 2002 Stage 1, Junior #2

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.

#### Sample Input

color
for
taylor
quit!

#### Sample Output

colour
for
taylour

• Lunazoul
commented on Nov. 14, 2017

Why does instructor work? instructour is not a word

• khysarth
commented on Nov. 14, 2017 edit 2

Deleted

• hezeyu2007001
commented on July 20, 2017

hello, anybody here?

• jpr4
commented on Nov. 28, 2016 edited
Deleted

Deleted

• Kirito
commented on Nov. 28, 2016 edited

Let it be known that hardcoding is a bannable offense.

• jpr4
commented on Nov. 30, 2016

Sorr, I do not know that. I will not do it anymore

• println_hi_
commented on Nov. 29, 2016 edit 3

Is mid-way hardcoding a bannable offence? For example would creating a giant array containing the primality of every number and copying and pasting it into my code be illegal for FHC:Homework (I have not done this)

• JustunLynn
commented on Nov. 12, 2015 edited

I keep on getting the wrong answer despite having the perfect outputs... Any solutions? I've made sure there are no logic errors or output errors, and I've had others evaluate my program whom have come to the same conclusion.

• Edit my code was removing the letter before the "or" if the letter wasn't a consonant. Thanks for help :)
• Phoenix1369
commented on Nov. 13, 2015

If the word has more than four letters and has a suffix consisting of a consonant followed by or

Your code does not check whether the letter before the suffix or is a consonant.

• kobortor
commented on Feb. 24, 2015

try this test case

forghghghghghgh

• qingjinlyc
commented on March 5, 2015

my program output fourghghghghghgh for your case.

But I still got WA, why?

My output is: neighbour, door, instructour and trans

• Anix55
commented on Oct. 21, 2015

did you forget to include the condition that the third last letter must be a consonant? if you forget this it would convert the word "floor" to "floour" which is not what you want.

• kobortor
commented on March 5, 2015

It's not supposed to change...

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
• qingjinlyc
commented on March 5, 2015

囧，我得回去提高我的英文水平了

• kobortor
commented on March 6, 2015

你的英文水平太好了。

/s

• bobhob314
commented on March 6, 2015

你这个爆乳傻子!!!!

• bobhob314
commented on March 6, 2015

嗐，qingjinlyc 哥们儿兄弟， 我没在侮辱您呢， 我在说 kobortor 的坏话呢。

• bobhob314
commented on March 6, 2015

哎呀, 我的弟兄呀...

• BMP
commented on March 5, 2015

ur sick bud

• GCash
commented on Feb. 24, 2015

Thanks haha it works now