#include <iostream>
using namespace std;

int main(int argc, char** argv) {
    int i = 0, input;
    //for(cin >> a[i]; a[i]; cin >> a[++i] )    ; ///do nothing
    //while(cin >> input) cout << input / 2 << "
";    ///OK
    //for(; cin >> input; ) cout << input / 2 << "
";    //OK
    for(cin >> input; input; cin >> input) cout << input / 2 << "
";   // 不行
    return 0;
}

第三道题把cin >> input放在for循环第三个表达式为何报错复杂度过大,  而把cin >> input放在while或者for循环做判断条件却可以通过. 先谢谢了Thanks♪(・ω・)ノ
2020-01-16
在牛客打卡2天,今天学习:刷题 6 道/代码提交 34 次
全部评论

相关推荐

投递腾讯等公司10个岗位
点赞 评论 收藏
分享
07-10 14:08
已编辑
江西农业大学 Java
拒绝无效加班的小学生...:期望3k吗?java这辈子有了
点赞 评论 收藏
分享
07-23 18:25
河北大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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