这题哪错了啊
2023-05-22 19:15:03
发布于:江苏
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int yy,cbs,bh,sbm,he,sum=0,is_sbm;
scanf("%d-%d-%d-%d",&yy,&cbs,&bh,&sbm); //&千万别忘了!
he=bh+cbs*100000+yy*100000000;
for(int i=0;i<9;i++){
int fj=1,ws;
for(int j=0;j<=i;j++) fj*=10;
if(i!=0) ws=((he%fj)-(he%(fj/10)))/(fj/10);
else ws=he%10;
sum+=ws*(i+1);
}
is_sbm=sum%11;
if(is_sbm==sbm) cout<<"Right";
else cout<<yy<<'-'<<cbs<<'-'<<bh<<'-'<<is_sbm;
return 0;
}
这里空空如也
有帮助,赞一个