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

2021-05-19 09:54:16 +08:00
 zxCoder

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

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

1990 次点击
所在节点    English
18 条回复
zhs227
2021-05-19 09:56:02 +08:00
output "white" if x is an odd number, otherwise "black".

瞎说的。
learningman
2021-05-19 09:57:00 +08:00
用 COBOL 写就和英文差不多了
hsfzxjy
2021-05-19 09:58:33 +08:00
output "white" if x is an odd number, and "black" otherwise.
noe132
2021-05-19 09:58:37 +08:00
怎么翻译都可以。中文也可以说 “输出 white 如果 x 是奇数,不然输出 black”。只不过英语 if 从句更自然,中文放前面更自然
Tianao
2021-05-19 10:01:33 +08:00
If 从句更自然,但楼主这样顺序表达显然更符合程序设计思想。
AoEiuV020
2021-05-19 10:04:09 +08:00
这种输入输出已经是计算机程序算法专业语言了吧,应该和日常口语不一样才是对的,准确描述可能要参考一些 online judge 网站上描述,
Mutoo
2021-05-19 10:12:16 +08:00
没感觉奇怪呀,通俗易懂。
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
2021-05-19 10:15:38 +08:00
int x =1;
if( x % 2 == 1){
System.out.println("white");
}
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
2021-05-19 10:16:46 +08:00
是的,写完就觉得 otherwise 应该放在最后面。赞同 hsfzxjy 的答案。
zxCoder
2021-05-19 10:49:05 +08:00
谢谢大家 学到很多
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
2021-05-19 11:40:16 +08:00
if 和 otherwise 出现在一个句中,有点奇怪...
pkookp8
2021-05-19 11:50:48 +08:00
x&1==0 ? output(black):output(white)
OnlyShimmer
2021-05-19 14:34:14 +08:00
return x&1==0?'black':'white'
chiu
2021-05-19 23:01:31 +08:00
Output "white" for odd X, otherwise "black".
Sunnic
2021-07-25 05:40:07 +08:00
If x odd , go "white" or "black".

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/777828

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX