SOS 30分求解

P1055 [NOIP2008 普及组] ISBN 号码

dingzijie13776810409 @ 2022-07-09 12:20:22

#include<iostream>
using namespace std;
int main()
{
    int a,c,d,e,g,h,i,j,k,m,shibiema,zshibiema;
    string b,f,l;
    cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j>>k>>l>>m;
    shibiema=a*1+c*2+d*3+e*4+g*5+h*6+i*7+j*8+k*9;
    zshibiema=shibiema%11;
    if(m==zshibiema) cout<<"Right";
    else cout<<a<<b<<c<<d<<e<<f<<g<<h<<i<<j<<k<<l<<zshibiema;
}

by hahazhou @ 2022-07-09 12:23:07

尝试一下scanf格式化输入


by William_Takazaki @ 2022-07-09 12:35:26

主页双帖,危


by Super_Supper @ 2022-07-09 12:41:13

@dingzijie13776810409 有没有一种可能,string 是字符串


|