if x is a odd number, output "white", otherwise, output "black".
我只会这样翻译,感觉怪怪的,应该怎么说比较好,我学习学习
if x is a odd number, output "white", otherwise, output "black".
我只会这样翻译,感觉怪怪的,应该怎么说比较好,我学习学习
|
1
output "white" if x is an odd number, otherwise "black".
瞎说的。 |
|
learningmanMay 19, 2021 via Android
2
用 COBOL 写就和英文差不多了
|
|
hsfzxjyMay 19, 2021 via Android
3
output "white" if x is an odd number, and "black" otherwise.
|
|
noe132May 19, 2021
4
怎么翻译都可以。中文也可以说 “输出 white 如果 x 是奇数,不然输出 black”。只不过英语 if 从句更自然,中文放前面更自然
|
|
TianaoMay 19, 2021 via iPhone
5
If 从句更自然,但楼主这样顺序表达显然更符合程序设计思想。
|
|
AoEiuV020May 19, 2021
6
这种输入输出已经是计算机程序算法专业语言了吧,应该和日常口语不一样才是对的,准确描述可能要参考一些 online judge 网站上描述,
|
|
MutooMay 19, 2021
7
没感觉奇怪呀,通俗易懂。
|
|
AoEiuV020May 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. |
|
yitingbaiMay 19, 2021
9
int x =1;
if( x % 2 == 1){ System.out.println("white"); } |
|
yitingbaiMay 19, 2021
10
int x = 1;
if (x % 2 == 1) { System.out.println("white"); } else { System.out.println("black"); } |
|
zhs227May 19, 2021
11
是的,写完就觉得 otherwise 应该放在最后面。赞同 hsfzxjy 的答案。
|
|
12
谢谢大家 学到很多
|
|
coderluanMay 19, 2021
13
such as fruit x yes chicken number, lose out white, no then lose out black.
|
|
wanku0225May 19, 2021
14
if 和 otherwise 出现在一个句中,有点奇怪...
|
|
pkookp8May 19, 2021 via Android
15
x&1==0 ? output(black):output(white)
|
|
OnlyShimmerMay 19, 2021
16
return x&1==0?'black':'white'
|
|
chiuMay 19, 2021
17
Output "white" for odd X, otherwise "black".
|
|
SunnicJul 25, 2021 via Android
18
If x odd , go "white" or "black".
|