Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71096 任斌 13求n个数的最小值 C++ Compile Error 0 MS 0 KB 198 2024-04-21 09:51:20

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int n,x,min; cin>>n; cin>>x; min=x;78 for(int i=2;i<=n;i++){ cin>>x; if(x<min) min=x; } cout<<min<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:2: error: expected ';' before 'for'
  for(int i=2;i<=n;i++){
  ^
Main.cc:9:13: warning: statement has no effect [-Wunused-value]
  for(int i=2;i<=n;i++){
             ^
Main.cc:9:14: error: 'i' was not declared in this scope
  for(int i=2;i<=n;i++){
              ^