zxCoder
V2EX  ›  English

如果 x 是奇数,输出 white,否则输出 black,英文怎么表达

  •  
  •   zxCoder · May 19, 2021 · 3266 views
    This topic created in 1994 days ago, the information mentioned may be changed or developed.

    if x is a odd number, output "white", otherwise, output "black".

    我只会这样翻译,感觉怪怪的,应该怎么说比较好,我学习学习

    18 replies  •  2021-07-25 05:40:07 +08:00
    zhs227
    zhs227
    May 19, 2021❤️1
    1
    output "white" if x is an odd number, otherwise "black".

    瞎说的。
    learningman
    learningman
    May 19, 2021 via Android
    2
    用 COBOL 写就和英文差不多了
    hsfzxjy
    hsfzxjy
    May 19, 2021 via Android
    3
    output "white" if x is an odd number, and "black" otherwise.
    noe132
    noe132
    May 19, 2021
    4
    怎么翻译都可以。中文也可以说 “输出 white 如果 x 是奇数,不然输出 black”。只不过英语 if 从句更自然,中文放前面更自然
    Tianao
    Tianao
    May 19, 2021 via iPhone
    5
    If 从句更自然,但楼主这样顺序表达显然更符合程序设计思想。
    AoEiuV020
    AoEiuV020
    May 19, 2021
    6
    这种输入输出已经是计算机程序算法专业语言了吧,应该和日常口语不一样才是对的,准确描述可能要参考一些 online judge 网站上描述,
    Mutoo
    Mutoo
    May 19, 2021
    7
    没感觉奇怪呀,通俗易懂。
    AoEiuV020
    AoEiuV020
    May 19, 2021
    8
    找到个差不多情况的描述,语法上和#3 差不多,
    https://codeforces.com/problemset/problem/1475/A

    For each test case, output on a separate line:

    "YES" if n has an odd divisor, greater than one;
    "NO" otherwise.
    yitingbai
    yitingbai
    May 19, 2021
    9
    int x =1;
    if( x % 2 == 1){
    System.out.println("white");
    }
    yitingbai
    yitingbai
    May 19, 2021
    10
    int x = 1;
    if (x % 2 == 1) {
    System.out.println("white");
    } else {
    System.out.println("black");
    }
    zhs227
    zhs227
    May 19, 2021
    11
    是的,写完就觉得 otherwise 应该放在最后面。赞同 hsfzxjy 的答案。
    zxCoder
    zxCoder
    OP
    May 19, 2021
    12
    谢谢大家 学到很多
    coderluan
    coderluan
    May 19, 2021
    13
    such as fruit x yes chicken number, lose out white, no then lose out black.
    wanku0225
    wanku0225
    May 19, 2021
    14
    if 和 otherwise 出现在一个句中,有点奇怪...
    pkookp8
    pkookp8
    May 19, 2021 via Android
    15
    x&1==0 ? output(black):output(white)
    OnlyShimmer
    OnlyShimmer
    May 19, 2021
    16
    return x&1==0?'black':'white'
    chiu
    chiu
    May 19, 2021
    17
    Output "white" for odd X, otherwise "black".
    Sunnic
    Sunnic
    Jul 25, 2021 via Android
    18
    If x odd , go "white" or "black".
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5056 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 07:34 · PVG 15:34 · LAX 23:34 · JFK 02:34
    ♥ Do have faith in what you're doing.