guoyanwei120223 @ 2024-08-06 17:20:46
by guoyanwei120223 @ 2024-08-06 17:21:39
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f,g,h,i,j,bm;
scanf("%d-%d%d%d-%d%d%d%d%d-%d",a,b,c,d,e,f,g,h,i,j);
bm=a*1+b*2+c*3+d*4+e*5+f*6+g*7+h*8+i*9;
bm=bm%11;
if(bm==j) cout<<"Right";
else cout<<bm;
return 0;
}
@guoyanwei120223
by damnM3bro @ 2024-08-06 17:23:21
@guoyanwei120223 scanf 变量名前加 &
by guoyanwei120223 @ 2024-08-06 17:50:46
@damnM3bro 还是不对
by guoyanwei120223 @ 2024-08-06 17:51:19
@damnM3bro 加了&之后还是0分
by Felix66 @ 2024-08-08 20:57:03
#include <bits/stdc++.h>
using namespace std;
int main() {
char s[14], c;
cin >> s;
int h = 0, k = 0;
for (int i = 0; i < 11; i++) {
if (s[i] != '-') {
k++;
h += k * (s[i] - '0');
}
}
h %= 11;
if (h == 10)
c = 'X';
else
c = h + '0';
if (c == s[12])
cout << "Right" << endl;
else {
s[12] = c;
cout << s;
}
return 0;
}
参考一下,我看不懂你的代码
求关
by Felix66 @ 2024-08-08 20:59:35
QwQ
by guoyanwei120223 @ 2024-08-09 15:32:26
@Felix66 谢谢大佬!!! 谢谢
by guoyanwei120223 @ 2024-08-09 15:33:42
@Felix66 关注你了,谢谢你