Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147315 任艺宸 22砝码的重量 C++ Compile Error 0 MS 0 KB 928 2026-02-04 11:03:57

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[1001]={},n,min=99999,x=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]>min){ a[i]=min; } x+=a[i]; }x=x-min; cout<<x<<endl; return 0; }#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[1001]={},n,min=99999,x=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]>min){ a[i]=min; } x+=a[i]; }x=x-min; cout<<x<<endl; return 0; }


Run Info:

Main.cc:19:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:19:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc: In function 'int main()':
Main.cc:25:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:7:5: note: 'int main()' previously defined here
 int main(){
     ^