Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149393 李亭绪 19斯诺克比赛 C++ Compile Error 0 MS 0 KB 475 2026-03-11 19:29:20

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 s=0,a[8]; for(int i=1;i<=7;i++){ cin>>a[i+1]; } if(a[1]){ for(int i=7;i>=1;i--) s+=a[1]*(1+i);break; } for(int i=7;i>=2;i--) s+=a[i]*i; cout<<s; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:27: error: break statement not within loop or switch
             s+=a[1]*(1+i);break;
                           ^