题解 | #输出 0 到 500 中 7 的倍数#
输出 0 到 500 中 7 的倍数
https://www.nowcoder.com/practice/8b85768394304511b0eb887244e51872
the key logic is to use the for loop to log the number which can be multiplied by 7, you can start with the js code below:
function multiple(i) { for (let i = 0; i < 500; i++) { if (i % 7 == 0) { console.log(i); } } } multiple(500)
Then conver this logic to the shell language:
[syntax error in conditional expression: unexpected token `;']
[BASH Syntax error near unexpected token 'done' duplicate]