题解 | #输出 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:

Clike loop

Shell 流程控制

[syntax error in conditional expression: unexpected token `;']

[BASH Syntax error near unexpected token 'done' duplicate]

全部评论

相关推荐

听说改名字就能收到offer哈:Radis写错了兄弟
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务