V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zxCoder
V2EX  ›  English

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

  •  
  •   zxCoder · 2021-05-19 09:54:16 +08:00 · 1986 次点击
    这是一个创建于 1066 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    18 条回复    2021-07-25 05:40:07 +08:00
    zhs227
        1
    zhs227  
       2021-05-19 09:56:02 +08:00   ❤️ 1
    output "white" if x is an odd number, otherwise "black".

    瞎说的。
    learningman
        2
    learningman  
       2021-05-19 09:57:00 +08:00 via Android
    用 COBOL 写就和英文差不多了
    hsfzxjy
        3
    hsfzxjy  
       2021-05-19 09:58:33 +08:00 via Android
    output "white" if x is an odd number, and "black" otherwise.
    noe132
        4
    noe132  
       2021-05-19 09:58:37 +08:00
    怎么翻译都可以。中文也可以说 “输出 white 如果 x 是奇数,不然输出 black”。只不过英语 if 从句更自然,中文放前面更自然
    Tianao
        5
    Tianao  
       2021-05-19 10:01:33 +08:00 via iPhone
    If 从句更自然,但楼主这样顺序表达显然更符合程序设计思想。
    AoEiuV020
        6
    AoEiuV020  
       2021-05-19 10:04:09 +08:00
    这种输入输出已经是计算机程序算法专业语言了吧,应该和日常口语不一样才是对的,准确描述可能要参考一些 online judge 网站上描述,
    Mutoo
        7
    Mutoo  
       2021-05-19 10:12:16 +08:00
    没感觉奇怪呀,通俗易懂。
    AoEiuV020
        8
    AoEiuV020  
       2021-05-19 10:13:33 +08:00
    找到个差不多情况的描述,语法上和#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
        9
    yitingbai  
       2021-05-19 10:15:38 +08:00
    int x =1;
    if( x % 2 == 1){
    System.out.println("white");
    }
    yitingbai
        10
    yitingbai  
       2021-05-19 10:15:58 +08:00
    int x = 1;
    if (x % 2 == 1) {
    System.out.println("white");
    } else {
    System.out.println("black");
    }
    zhs227
        11
    zhs227  
       2021-05-19 10:16:46 +08:00
    是的,写完就觉得 otherwise 应该放在最后面。赞同 hsfzxjy 的答案。
    zxCoder
        12
    zxCoder  
    OP
       2021-05-19 10:49:05 +08:00
    谢谢大家 学到很多
    coderluan
        13
    coderluan  
       2021-05-19 11:00:36 +08:00
    such as fruit x yes chicken number, lose out white, no then lose out black.
    wanku0225
        14
    wanku0225  
       2021-05-19 11:40:16 +08:00
    if 和 otherwise 出现在一个句中,有点奇怪...
    pkookp8
        15
    pkookp8  
       2021-05-19 11:50:48 +08:00 via Android
    x&1==0 ? output(black):output(white)
    OnlyShimmer
        16
    OnlyShimmer  
       2021-05-19 14:34:14 +08:00
    return x&1==0?'black':'white'
    chiu
        17
    chiu  
       2021-05-19 23:01:31 +08:00
    Output "white" for odd X, otherwise "black".
    Sunnic
        18
    Sunnic  
       2021-07-25 05:40:07 +08:00 via Android
    If x odd , go "white" or "black".
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   948 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:11 · PVG 04:11 · LAX 13:11 · JFK 16:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.