当前位置:网站首页>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'边栏推荐
- 软件测试学习-黑马程序员,软件测试学习大纲
- When the publish / subscribe mode encounters NET
- Hash encryption
- Asemi rectifier bridge kbp310 function pin diagram
- [UVM foundation] build of UVM_ Phase execution sequence
- Use lamda expression and stream flow to traverse map and list
- d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
- All you want to know about large screen visualization is here
- After the number length of Oracle exceeds 19, the entity uses long mapping. Why does this cause problems?
- Teach you how to realize pynq-z2 bar code recognition
猜你喜欢

ROS "topic" programming implementation

leetcode 92. Reverse linked list II

Wanzhou gold industry: what are the differences between gold t+d investment and other investments?

Leetcode 46 Full Permutation

Asemi rectifier bridge kbp310 function pin diagram

leetcode 142. Circular linked list II

Part 31 supplement (31) ECMAScript conversion to string and number

Wechat applet map displays the current position with annotation

Overview of Inspur Yunxi database executor

Bit. Store: long bear market, stable stacking products may become the main theme
随机推荐
Introduction to photoswape
Application of scaleflux CSD 2000 in Ctrip
Software testing Basics - software testing history, process, classification, benefits, limitations
Advanced learning of MySQL -- Application -- Optimization of other SQL statements
Advanced learning of MySQL -- Application -- view, stored procedure, trigger
428 binary tree (501. mode in binary search tree, 701. insert operation in binary search tree, 450. delete node in binary search tree, 669. prune binary search tree)
07. Express routing
WOx WPM installing the Youdao plug-in
Under the influence of external factors, how to manage internal resources and reduce costs is the key
Kubernetes basic self-study series | introduction to ingress API
d3dx9_ Where is 35.dll? d3dx9_ Where can I download 35.dll
leetcode 142. Circular linked list II
Asemi rectifier bridge kbp310 function pin diagram
1. introduction to MariaDB
Use lamda expression and stream flow to traverse map and list
2022 Liaoning's latest eight members (Safety Officer) simulated test question bank and answers
全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?
Hospital reservation and registration system - system structure
ROS "topic" programming implementation