* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.2 KiB
1.2 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
56533eb9ac21ba0edf2244b3 | 将摄氏度转换为华氏度 | 1 | 16806 | convert-celsius-to-fahrenheit |
--description--
将摄氏度转换为华氏度的计算方式为:摄氏度乘以 9/5
然后加上 32
。
输入参数 celsius
代表一个摄氏度的温度。请根据上述转换公式,将已定义好的 fahrenheit
变量赋值为相应的华氏度的温度值。
--hints--
convertToF(0)
应返回一个数字。
assert(typeof convertToF(0) === 'number');
convertToF(-30)
应返回 -22
。
assert(convertToF(-30) === -22);
convertToF(-10)
应返回 14
。
assert(convertToF(-10) === 14);
convertToF(0)
应返回 32
。
assert(convertToF(0) === 32);
convertToF(20)
应返回 68
。
assert(convertToF(20) === 68);
convertToF(30)
应返回 86
。
assert(convertToF(30) === 86);
--seed--
--seed-contents--
function convertToF(celsius) {
let fahrenheit;
return fahrenheit;
}
convertToF(30);
--solutions--
function convertToF(celsius) {
let fahrenheit = celsius * 9/5 + 32;
return fahrenheit;
}
convertToF(30);