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