Compile Error

foo.cc:2:1: error: ‘g’ does not name a type
    2 | g++ -std=c++11 your_file.cpp -o your_program
      | ^
foo.cc: In function ‘int main()’:
foo.cc:10:9: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
   10 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from stdc++.h:149:
/nix/gcc-15.2.0/include/c++/15.2.0/iostream:64:18: note: ‘std::cin’ declared here
   64 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
foo.cc:20:9: error: ‘sort’ was not declared in this scope; did you mean ‘std::sort’?
   20 |         sort(kid+1,kid+1+n,[](node x,node y){return x.bmi>y.bmi;});
      |         ^~~~
      |         std::sort
In file included from /nix/gcc-15.2.0/include/c++/15.2.0/algorithm:63,
                 from stdc++.h:53:
/nix/gcc-15.2.0/include/c++/15.2.0/bits/stl_algo.h:4862:5: note: ‘std::sort’ declared here
 4862 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
foo.cc:21:31: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   21 |         for(int i=1;i<=n;i++) cout<<kid[i].number<<" ";
      |                               ^~~~
      |                               std::cout
/nix/gcc-15.2.0/include/c++/15.2.0/iostream:65:18: note: ‘std::cout’ declared here
   65 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~

信息

递交者
类型
递交
题目
P3131 身高体重指数 GESP202606四级T2
语言
C++
递交时间
2026-07-19 10:02:35
评测时间
2026-07-19 10:02:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes