当前位置:网站首页>Contest3182 - the 39th individual training match for 2021 freshmen_ C: [string] ISBN number
Contest3182 - the 39th individual training match for 2021 freshmen_ C: [string] ISBN number
2022-06-27 18:29:00 【This question AC sleep again】

The sample input Copy
0-670-82162-4
Sample output Copy
Right//
#include<bits/stdc++.h>
using namespace std;
const int MAXN=22;
char str[MAXN];
int main()
{
int sum,cnt,ans,i;
while( ~scanf("%s",str) )
{
sum=0; cnt=1;
for( i=0;cnt!=10;i++ )
{
if( isdigit( str[i] ) )
{
sum+=( str[i]-'0' )*cnt;
cnt++;
}
}
ans=sum%11;
if( ans==10 ) // 1-000-00001-1
{
if( str[12]=='X' ) printf("Right\n");
else { str[12]='X'; printf("%s\n",str); }
}
else if( ans+'0'==str[12] ) printf("Right\n");
else { str[12]=ans+'0'; printf("%s\n",str); }
}
return 0;
}//
find:
01
9 1 3 == 13
0~12
02 Special judgement 'X'边栏推荐
- Control file related views
- (5) SPI application design and simulation verification 3 - verification code implementation
- About redis master-slave replication
- Project team management - Tuckman ladder theory
- SQLite net (SQLite is used by unity, WPF and WinForm)
- Delete duplicate elements in the sorting linked list
- Advanced learning of MySQL -- Application -- view, stored procedure, trigger
- Some details of Huawei OSPF
- 医院预约挂号系统-系统结构
- [multithreading] thread communication scheduling, waiting set wait(), notify()
猜你喜欢

Oracle concept II
![[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes](/img/cb/0be2b2cf3b2cfa903190b7795d3cd7.jpg)
[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes

医院预约挂号系统-系统结构

Hospital reservation and registration system - system structure

Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration

Project team management - Tuckman ladder theory
![[multithreading] thread communication scheduling, waiting set wait(), notify()](/img/4b/b9312fafd1ef1bf438f7aec7665276.png)
[multithreading] thread communication scheduling, waiting set wait(), notify()

How to improve it electronic equipment performance management

Synchronization mechanism of dual namenodes

Asemi rectifier bridge kbp310 function pin diagram
随机推荐
Asemi rectifier bridge kbp307 parameters, kbp307 details, kbp307 pictures
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
The power of code refactoring: how to measure the success of refactoring
Redis installation
Performance problems caused by redis cache invalidation and competitive loading
Leetcode 5. Longest Palindromic Substring
Explain the distributed computing of Apache skywalking OAP in detail
TDengine在数控机床监控中的应用
GAC Mitsubishi's new outlander made its first domestic debut in the year, and its product strength was fully renewed
Missing d3d10 How to repair DLL files? Where can I download d3d10.dll
TP5 generates the most detailed two-dimensional code tp6 (also available)
(POJ - 1847) tram (shortest circuit)
JXL export Excel
医院预约挂号系统-系统结构
Related configuration commands of Huawei LACP
Under the influence of external factors, how to manage internal resources and reduce costs is the key
Jeesite 4.0 replaces the default view style and customizes the theme
All you want to know about large screen visualization is here
Alibaba cloud server is invaded
如何提升IT电子设备效能管理