paulyang120 @ 2022-11-21 17:24:30
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[13],n=0;
for(int i=1;i<=13;i++)
cin>>a[i];
for(int i=1;i<=11;i++)
{
if(i!='-')
n+=a[i]*i;
}
n=n%11;
if(n==a[13])
cout<<"Right";
else
cout<<n;
}
by 晴空一鹤 @ 2022-11-21 17:26:15
@yangzhengxi 这题不能这么读入
by hukk @ 2022-11-21 17:26:56
数组 a 越界了哦。
by mywzj_mo @ 2022-11-21 17:27:35
数组越界+int
类型读入‘ - ’,RE属于你
by mywzj_mo @ 2022-11-21 17:29:34
还有输出根本不对(我说的是else
部分)
by paulyang120 @ 2022-11-23 15:08:19
@晴空一鹤 醍醐灌顶,懂了!!!感谢
by paulyang120 @ 2022-11-23 15:08:45
@hukk 懂了谢谢