当前位置:网站首页>Contest3145 - the 37th game of 2021 freshman individual training match_ B: Password
Contest3145 - the 37th game of 2021 freshman individual training match_ B: Password
2022-07-06 09:53:00 【This question AC sleep again】

//
// " Just increase the number of digits of the password to no more than 200 It's just a bit "
// Conventional high precision
#include<bits/stdc++.h>
using namespace std;
const int MAXN=222;
char a[MAXN],b[MAXN],ans[MAXN];
void init()
{
memset( a,0,sizeof( a ) );
memset( b,0,sizeof( b ) );
memset( ans,0,sizeof( ans ) );
}
void process( char str[] )
{
char *p1=str;
char *p2=str+strlen(str)-1;
char temp;
while( p1<p2 )
{
temp=*p1; *p1=*p2; *p2=temp;
p1++; p2--;
}
for( int i=0;str[i];i++ ) str[i]-='0';
}
int main()
{
int i,pro; init();
while( ~scanf("%s%s",&a,&b) )
{
process(a); process(b);
pro=0;
for( i=0;i<MAXN-5;i++ )
{
ans[i]=( a[i]+b[i]+pro )%10;
pro=( a[i]+b[i]+pro )/10;
}
for( i=MAXN-5; ans[i]==0 && i ;i-- );
for( ;i>=0;i-- ) printf("%d",ans[i]);
printf("\n");
init();
}
return 0;
}边栏推荐
- 零基础学习单片机切记这四点要求,少走弯路
- Hero League rotation map automatic rotation
- [deep learning] semantic segmentation: paper reading: (2021-12) mask2former
- 51单片机进修的一些感悟
- [NLP] bert4vec: a sentence vector generation tool based on pre training
- Take you back to spark ecosystem!
- 通过bat脚本配置系统环境变量
- I2C summary (single host and multi host)
- 五月刷题27——图
- Mapreduce实例(八):Map端join
猜你喜欢

在CANoe中通过Panel面板控制Test Module 运行(高级)

学习单片机对社会的帮助是很大的

Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions

Mapreduce实例(十):ChainMapReduce

Combined search /dfs solution - leetcode daily question - number of 1020 enclaves

Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable

CAPL 脚本对.ini 配置文件的高阶操作

Mapreduce实例(七):单表join

51单片机进修的一些感悟

Nc29 search in two-dimensional array
随机推荐
Hugo blog graphical writing tool -- QT practice
零基础学习单片机切记这四点要求,少走弯路
CANoe不能自动识别串口号?那就封装个DLL让它必须行
机械工程师和电气工程师方向哪个前景比较好?
Solve the problem of too many small files
[flask] crud addition and query operation of data
嵌入式中的合作开发--函数指针
一大波開源小抄來襲
六月刷题02——字符串
Learning SCM is of great help to society
Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
Workflow - activiti7 environment setup
May brush question 26 - concurrent search
Leetcode:608 tree node
五月集训总结——来自阿光
Canoe CAPL file operation directory collection
CAPL script pair High level operation of INI configuration file
在CANoe中通过Panel面板控制Test Module 运行(高级)