做程序员多长时间了?不觉得这样一天天过的太无聊吗?
怎样才能让无聊的时间变得更无聊呢?
来吧,大家一起写一段再熟悉不过的程序,尽情发挥吧!题目:弹出一个对话框,内容和标题都是“HelloWorld!”
要求:
1.程序尽可能的多做功,但不得做无用功(例如进行复杂的数学运算却对结果不予理会,调用一堆API做无关的操作,把变量加1再减1再加1,等等)。所有的运算和操作都必须和结果有关
2.使用尽可能多的变量、系统资源等,但不能申请了资源却不使用。除了"Hello World!"以外不得返回任何其他结果。
3.同一数字和字符串不应多次出现(例如把"Hello World!"一次赋值给几百个字符串)
4.程序尽可能的冗长,尽可能的嵌套设计语言里允许使用的任何结构,运用尽可能多的对象和方法,使得他人完全无法阅读。
5.大家看还缺什么要求?最后,希望大家收藏此贴,长回来看看!

解决方案 »

  1.   


    public class HelloWorld {
    public static void main(String[] args) {
    try {
    if (new RuntimeException() {
    boolean n() {
    switch (getStackTrace().length) {
    case 3:
    return false;
    case 4:
    return true;
    default:
    printStackTrace();
    throw this;
    }
    } public void printStackTrace() {
    main(null);
    };
    }.n()) {
    System.out.print("Hello ");
    } else {
    System.out.println("world!");
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
      

  2.   

    if(你是猪)
    {
    if(你是鸡)
    {
    if(你是鸭)
    {
    if(你是鹅)
    {
    if(你是猫)
    {
    if(你是狗)
    {
    if(你是兔)
    {
    if(你是蛇)
    {
    if(你是鸟)
    {
    if(你是屎)
    {
    alert('hello world');
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }