当前位置:网站首页>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;
}
边栏推荐
- max-flow min-cut
- 小白带你重游Spark生态圈!
- Webrtc blog reference:
- Elk project monitoring platform deployment + deployment of detailed use (II)
- [deep learning] semantic segmentation: paper reading: (2021-12) mask2former
- Une grande vague d'attaques à la source ouverte
- Cap theory
- Several ways of MySQL database optimization (pen interview must ask)
- 五月刷题02——字符串
- 51单片机进修的一些感悟
猜你喜欢
随机推荐
【深度學習】語義分割-源代碼匯總
Day 5 of MySQL learning
One article read, DDD landing database design practice
一大波开源小抄来袭
Some thoughts on the study of 51 single chip microcomputer
小白带你重游Spark生态圈!
Mapreduce实例(八):Map端join
Yarn organizational structure
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
Elk project monitoring platform deployment + deployment of detailed use (II)
【深度学习】语义分割-源代码汇总
Basic concepts of libuv
C杂讲 文件 续讲
手把手教您怎么编写第一个单片机程序
Some thoughts on the study of 51 single chip microcomputer
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
Hard core! One configuration center for 8 classes!
YARN组织架构
发生OOM了,你知道是什么原因吗,又该怎么解决呢?
【深度学习】语义分割:论文阅读(NeurIPS 2021)MaskFormer: per-pixel classification is not all you need