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

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-03 18:13
点赞 评论 收藏
分享
06-18 13:28
已编辑
门头沟学院 Web前端
爱睡觉的冰箱哥:《给予你300的工资》,阴的没边了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务