题解 | #小乐乐排电梯#

小乐乐排电梯

https://www.nowcoder.com/practice/0f855c7642b74cccb3c2366bb7732d2a

#include <iostream>

using namespace std;

int main() {

    int n,t,i{};

    while (cin >> n ) { // 注意 while 处理多个 case

    for(i=0;n>=12;i++){

        n-=12;

    }

t=4*i+2;

        cout << t<< endl;

    }

}

全部评论

相关推荐

给个offer灞:校友 是不是金die
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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