Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
145372 杨登博 22砝码的重量 C++ Compile Error 0 MS 0 KB 538 2026-01-25 15:00:39

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 n,ai[101],min=101; cin>>n; for(int i=1;i<=n;i++){ cin>>ai[i]; y+=x[i]*2; t+=x[i]*4; } for(int i=1;i<=n;i++){ if(min<ai[i]) min=ai[i]; s+=ai[i]; int w=s-min; } cout<<w; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:9: error: 'y' was not declared in this scope
         y+=x[i]*2;
         ^
Main.cc:12:12: error: 'x' was not declared in this scope
         y+=x[i]*2;
            ^
Main.cc:13:9: error: 't' was not declared in this scope
         t+=x[i]*4;
         ^
Main.cc:18:9: error: 's' was not declared in this scope
         s+=ai[i];
         ^
Main.cc:19:13: warning: unused variable 'w' [-Wunused-variable]
         int w=s-min;
             ^
Main.cc:21:11: error: 'w' was not declared in this scope
     cout<