- ISBN号码
- 2017-08-14 17:20:30 @
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d=0,e,f,i=0;
char n[1] = {'-'};
char g[11] = {'0','1','2','3','4','5','6','7','8','9','X' },h;
cin >> a >> n[0] >> b >> n[0] >> c >> n[0] >> h;
for (d = 1; d < 10; d++)
{
if (g[d] == h)
i = d;
}
e = a * 1 + ((b / 100) * 2) + ((b - (b / 100) * 100) / 10 * 3) + ((b % 10) * 4) + c / 10000* 5 + (c - (c / 10000) * 10000) / 1000 * 6 + (c - (c / 1000) * 1000) / 100 * 7 + (c - (c / 100) * 100) / 10 * 8 + c % 10 * 9;
f = e % 11;
if (f != i)
{
cout << a << n[0] << b << n[0] << c << n[0] << g[f];
}
if (f==i)
{
cout << "Right";
}
}
1 条评论
-
A.Nozomu LV 7 @ 2017-10-25 15:19:11
没换行
- 1