X : Merry Christmas!

24Dec13

I recently participated in the Advent Programming Contest 2013 organised by the IEEE Student Branch Klagenfurt (with support from Alpen-Adria-Universität Klagenfurt), wherein – as I’d recently received from Udacity a certificate for Introduction to Programming : Problem Solving with Java (CS046) – I challenged myself to program my solutions to the problems posed by the contest using only Java (I’d used C and C++ when I’d participated in the contest in 2012); I solved eighteen of the problems posed by the contest, achieving a rank of 10th (out of 155 participants).

As submissions of solutions to the contest are now closed, I’m posting here the solutions I submitted to the contest.

Problem (X; easiest difficulty):

Merry Christmas!

This is the last problem in the Advent Programming Contest 2013! Now it is time to wish a merry Christmas!

Problem

Implement a program that writes “merry christmas” in the four languages with the largest number of native speakers, beginning with the language with the most native speakers. Output should be all lowercase, no exclamation or punctuation marks, newline after each wish. Only letters from the English alphabet should be used, diacritical marks should be left out. For example the French “Joyeux Noël!” would be written as “joyeux noel”. If there are several phrases for “merry christmas” in one of the languages which are common, use the shorter version.

Hint

A magyar nyelv nincs azon négy nyelvek között, melyek a legtöbb anyanyelvű beszélővel rendelkeznek.

Solution (X.java):

public class X
{
  public static void main( String p[] )
  {
    System.out.println( "shengdan jie kuaile" ); // Mandarin
    System.out.println( "feliz navidad" );       // Spanish
    System.out.println( "merry christmas" );     // English
    System.out.println( "meri krisamasa" );      // Hindi
  }
}

Testing:

shengdan jie kuaile
feliz navidad
merry christmas
meri krisamasa
Advertisements


No Responses Yet to “X : Merry Christmas!”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: