当前位置:网站首页>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;
}
边栏推荐
- 一大波开源小抄来袭
- Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable
- 33岁可以学PLC吗
- 五月刷题03——排序
- MapReduce instance (VI): inverted index
- Mapreduce实例(八):Map端join
- Can I learn PLC at the age of 33
- Basic concepts of libuv
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
- What are the models of data modeling
猜你喜欢
手把手教您怎么编写第一个单片机程序
[deep learning] semantic segmentation: paper reading: (CVPR 2022) mpvit (cnn+transformer): multipath visual transformer for dense prediction
CAPL 脚本对.ini 配置文件的高阶操作
[one click] it only takes 30s to build a blog with one click - QT graphical tool
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
MapReduce instance (V): secondary sorting
Selection of software load balancing and hardware load balancing
Mapreduce实例(五):二次排序
Defensive C language programming in embedded development
Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
随机推荐
CAP理论
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
Inject common SQL statement collation
通过bat脚本配置系统环境变量
[Chongqing Guangdong education] reference materials for nine lectures on the essence of Marxist Philosophy in Wuhan University
MapReduce instance (IV): natural sorting
[NLP] bert4vec: a sentence vector generation tool based on pre training
Mapreduce实例(五):二次排序
Cooperative development in embedded -- function pointer
C杂讲 文件 初讲
tn-c为何不可用2p断路器?
Take you back to spark ecosystem!
Why is 51+ assembly in college SCM class? Why not come directly to STM32
Webrtc blog reference:
May brush question 27 - figure
Hard core! One configuration center for 8 classes!
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
Compilation of libwebsocket
【深度學習】語義分割-源代碼匯總
五月刷题26——并查集