Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>n>>k;
      |         ^~~
/in/foo.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
/in/foo.cc:12:20: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   12 |                 if(a[i]<=min)
      |                    ^
/in/foo.cc:12:26: error: 'min\U0000ff09' was not declared in this scope
   12 |                 if(a[i]<=min)
      |                          ^~~~~
/in/foo.cc:14:9: error: expected primary-expression before '}' token
   14 |         }
      |         ^
/in/foo.cc:13:29: error: expected ')' before '}' token
   13 |                    min=a[i];
      |                             ^
      |                             )
   14 |         }
      |         ~                    
/in/foo.cc:12:19: note: to match this '('
   12 |                 if(a[i]<=min)
      |                   ^
/in/foo.cc:14:9: error: expected primary-expression before '}' token
   14 |         }
      |         ^
/in/foo.cc:22:20: error: 'cout' was not declared in this scope
   22 |                    cout<<a[i];
      |                    ^~~~
/in/foo.cc:22:20: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?

信息

递交者
类型
自测
题目
P2851 数字替换2024.12GESP3级T1
语言
C++
递交时间
2025-11-05 11:53:27
评测时间
2025-11-05 11:53:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes