V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
shoumu
V2EX  ›  程序员

Write a program that makes 2 + 2 = 5

  •  
  •   shoumu ·
    shoumu · Jun 2, 2014 · 4098 views
    This topic created in 4347 days ago, the information mentioned may be changed or developed.
    11 replies    2014-06-13 17:29:14 +08:00
    manfay
        1
    manfay  
       Jun 2, 2014
    Python
    >>> def addd(a,b):
    ............c = a+b
    ............return c//4 + c
    >>> addd(2,2)
    5
    >>> addd(4,4)
    10
    cbsw
        2
    cbsw  
       Jun 2, 2014
    那个 C 版本真逗逼,竟然把 a++ 放到可视范围外
    killpanda
        3
    killpanda  
       Jun 3, 2014
    C 的那个太逗了
    lm902
        4
    lm902  
       Jun 3, 2014
    那个C的笑死我了
    kfll
        5
    kfll  
       Jun 3, 2014
    C; ++..........
    lucifer9
        6
    lucifer9  
       Jun 3, 2014
    这不是只要一行 printf 就行了吗
    shyrock
        7
    shyrock  
       Jun 3, 2014
    纯娱乐?没看到有价值的代码。。。
    shoumu
        8
    shoumu  
    OP
       Jun 3, 2014
    @shyrock Java那个还是有价值吧
    wizardoz
        9
    wizardoz  
       Jun 3, 2014
    不知所云。
    我认为无论如何都无法使 2 + 2 = 5。
    你的代码算出 2 + 2 = 5,只能说你代码错了。
    yanyuechuixue
        10
    yanyuechuixue  
       Jun 3, 2014
    C那个太逗比了~!!!!
    shyrock
        11
    shyrock  
       Jun 13, 2014
    @shoumu 价值何在?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5650 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 06:51 · PVG 14:51 · LAX 23:51 · JFK 02:51
    ♥ Do have faith in what you're doing.