Skip to content

Instantly share code, notes, and snippets.

@hyuki0000
Created September 19, 2013 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki0000/6622058 to your computer and use it in GitHub Desktop.
Save hyuki0000/6622058 to your computer and use it in GitHub Desktop.
CodeIQ で @cielavenir 氏が出題した「リテラルを使わずにHello Worldを出力せよ」という問題への結城浩の解答です。評価5をいただきました。ありがとうございます。 https://codeiq.jp/ace/cielavenir/q431 https://github.com/cielavenir/codeiq_problems/tree/master/q431
class Hello {}
class World {}
class Main {
public static void main(String[] args) {
String h = Hello.class.getName(), w = World.class.getName();
System.out.println(h + (char)(h.length() / h.length() << w.length()) + w);
}
}
@hyuki0000
Copy link
Author

一番苦労したのはスペース一文字を作るところでした……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment