Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140975 汪义罗 19斯诺克比赛 C++ Compile Error 0 MS 0 KB 267 2025-12-20 15:02:01

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a[8],sum=0; for(int i=1;i<8;i++){ cin>>a[i]; } if(a[1]!=0){ int i=7; while(a[i]==0)i--;a sum+=a[i]*(1+i); } for(int i=2;i<=7;i++){ sum+=a[i]*i; } cout<<sum; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:3: error: expected ';' before 'sum'
   sum+=a[i]*(1+i);
   ^
Main.cc:11:18: warning: statement has no effect [-Wunused-value]
   sum+=a[i]*(1+i);
                  ^