c语言为什么显示编译错误啊,在自己编译器上是成功的

P1035 [NOIP2002 普及组] 级数求和

hello098 @ 2023-09-07 17:48:55

#include <stdio.h>
int main()
{
    int k,n = 0;
    double s = 0.0;
    scanf("%d",&k);

    while(s<=k){
        n++;
        s = s + 1.0/n;
    }
    printf("%d",n);

    return 0;

by Creeper_l @ 2023-09-07 17:51:48

少写了一个括号(


by changpin_zhze @ 2023-09-07 17:52:53

主函数没大括号收尾?@hello098


by FurippuWRY @ 2023-09-07 18:14:12

return 0;后边加个大括号


|