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

2021 年 5 月 19 日
 zxCoder

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

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

2713 次点击
所在节点    English
18 条回复
zhs227
2021 年 5 月 19 日
output "white" if x is an odd number, otherwise "black".

瞎说的。
learningman
2021 年 5 月 19 日
用 COBOL 写就和英文差不多了
hsfzxjy
2021 年 5 月 19 日
output "white" if x is an odd number, and "black" otherwise.
noe132
2021 年 5 月 19 日
怎么翻译都可以。中文也可以说 “输出 white 如果 x 是奇数,不然输出 black”。只不过英语 if 从句更自然,中文放前面更自然
Tianao
2021 年 5 月 19 日
If 从句更自然,但楼主这样顺序表达显然更符合程序设计思想。
AoEiuV020
2021 年 5 月 19 日
这种输入输出已经是计算机程序算法专业语言了吧,应该和日常口语不一样才是对的,准确描述可能要参考一些 online judge 网站上描述,
Mutoo
2021 年 5 月 19 日
没感觉奇怪呀,通俗易懂。
AoEiuV020
2021 年 5 月 19 日
找到个差不多情况的描述,语法上和#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 年 5 月 19 日
int x =1;
if( x % 2 == 1){
System.out.println("white");
}
yitingbai
2021 年 5 月 19 日
int x = 1;
if (x % 2 == 1) {
System.out.println("white");
} else {
System.out.println("black");
}
zhs227
2021 年 5 月 19 日
是的,写完就觉得 otherwise 应该放在最后面。赞同 hsfzxjy 的答案。
zxCoder
2021 年 5 月 19 日
谢谢大家 学到很多
coderluan
2021 年 5 月 19 日
such as fruit x yes chicken number, lose out white, no then lose out black.
wanku0225
2021 年 5 月 19 日
if 和 otherwise 出现在一个句中,有点奇怪...
pkookp8
2021 年 5 月 19 日
x&1==0 ? output(black):output(white)
OnlyShimmer
2021 年 5 月 19 日
return x&1==0?'black':'white'
chiu
2021 年 5 月 19 日
Output "white" for odd X, otherwise "black".
Sunnic
2021 年 7 月 25 日
If x odd , go "white" or "black".

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

https://study.congcong.us/t/777828

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

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

© 2021 V2EX