Mã chấm Tài khoản Bài tập Ngôn ngữ lập trình Trạng thái Thời gian Bộ nhớ Kích thước Thời gian nộp
596594 Nguyễn Đan Huy Pháp sư C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 544 2024-10-31 19:24:22

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:6:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
    6 |     cin>>n>>s;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from Main.cc:1:
/usr/include/c++/11/iostream:60:18: note: ‘std::cin’ declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
Main.cc:9:5: error: ‘sort’ was not declared in this scope; did you mean ‘std::sort’?
    9 |     sort(a+1,a+n+1);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from Main.cc:1:
/usr/include/c++/11/bits/stl_algo.h:4863:5: note: ‘std::sort’ declared here
 4863 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
Main.cc:27:5: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   27 |     cout<