求调,编译失败

P2669 [NOIP2015 普及组] 金币

que_de_yu_fu @ 2024-12-01 00:04:05

#include<iostream>
using namespace std;
int k,n=1,a,i,j;
int main{
    cin>>k;
    for(i=1;i<=k;i++){
        if(i>n){
            n+=n+1;
            j+=1;
        }
        a+=j;
    }
    cout<<a<<endl;
    return 0;
}

真的服了,平白无故为什么会编译失败啊


by Jibi_lai31415926 @ 2024-12-01 07:00:31

main函数的括号忘加了@que_de_yu_fu


by Messis @ 2024-12-01 07:36:43

main后边()没加


by que_de_yu_fu @ 2024-12-01 08:26:39

@Jibi_lai31415926啊啊啊!我太傻了对不起


|