问题标题: 酷町堂:哪儿错了

0
0
已解决
王煜辰
王煜辰
初级光能
初级光能

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    int a,b=0,c=1,d=0,e=0;
    cin>>a;
    while(true){
        if(c>=a){
            break;
        }else{
            c*=2;
            d++;
        }
        cout<<d;
    }
    for(int i=1;i<=d;i++){
        for(int j=1;j<=c;j++){
            b+=e;
            cout<<b<<" ";
        }
        e++;
    }
    cout<<b;
    return 0;   
}

王煜辰在2023-03-15 19:45:16追加了内容

快一点


0
已采纳
杨真如
杨真如
资深守护
资深守护

哪道题啊?这么多天你一直没上问答吗?

0
0
0
0
我要回答