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
| ^~~~