CCC '02 J2 - AmeriCanadian

View as PDF

Submit solution


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

Report an issue

Comments


  • 0
    Lunazoul
     commented on Nov. 14, 2017

    Why does instructor work? instructour is not a word


  • 0
    khysarth
     commented on Nov. 14, 2017 edit 2

    Deleted


  • -5
    hezeyu2007001
     commented on July 20, 2017

    hello, anybody here?


  • -6
    jpr4
     commented on Nov. 28, 2016 edited
    Deleted

    Deleted


    • 2
      Kirito
       commented on Nov. 28, 2016 edited

      Let it be known that hardcoding is a bannable offense.


      • -2
        jpr4
         commented on Nov. 30, 2016

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


      • -2
        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)


  • -1
    JustunLynn
     commented on Nov. 12, 2015 edited
    Wrong Answer?

    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 :)

    • 0
      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.


    • 4
      kobortor
       commented on Feb. 24, 2015

      try this test case

      forghghghghghgh


      • -3
        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


        • -3
          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.


        • 0
          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

          • 7
            qingjinlyc
             commented on March 5, 2015

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


            • -3
              kobortor
               commented on March 6, 2015

              你的英文水平太好了。

              /s


              • -7
                bobhob314
                 commented on March 6, 2015

                你这个爆乳傻子!!!!


                • -4
                  bobhob314
                   commented on March 6, 2015

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


            • -7
              bobhob314
               commented on March 6, 2015

              哎呀, 我的弟兄呀...


          • -11
            BMP
             commented on March 5, 2015

            ur sick bud


      • -8
        GCash
         commented on Feb. 24, 2015

        Thanks haha it works now