当前位置:网站首页>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;
}
边栏推荐
- CAPL script pair High level operation of INI configuration file
- 33岁可以学PLC吗
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
- CANoe不能自动识别串口号?那就封装个DLL让它必须行
- 听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
- Processes of libuv
- Some thoughts on the study of 51 single chip microcomputer
- One article read, DDD landing database design practice
- Meituan Er Mian: why does redis have sentinels?
- Bugku web guide
猜你喜欢
嵌入式开发比单片机要难很多?谈谈单片机和嵌入式开发设计经历
Une grande vague d'attaques à la source ouverte
MapReduce instance (VII): single table join
[one click] it only takes 30s to build a blog with one click - QT graphical tool
Nc17 longest palindrome substring
在CANoe中通過Panel面板控制Test Module 運行(初級)
MapReduce working mechanism
Programmation défensive en langage C dans le développement intégré
学习单片机对社会的帮助是很大的
51单片机进修的一些感悟
随机推荐
There are software load balancing and hardware load balancing. Which one to choose?
O & M, let go of monitoring - let go of yourself
A wave of open source notebooks is coming
Solve the problem of too many small files
I2C summary (single host and multi host)
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
Canoe CAPL file operation directory collection
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
If a university wants to choose to study automation, what books can it read in advance?
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
Delayed note learning
Why data Tiering
[deep learning] semantic segmentation - source code summary
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks
通过bat脚本配置系统环境变量
Mapreduce实例(四):自然排序
Teach you how to write the first MCU program hand in hand
六月刷题01——数组
CANoe的数据回放(Replay Block),还是要结合CAPL脚本才能说的明白