Experience the high-precision Algorithms
/*
* ===================================================== ========================================================== ======
*
* Filename: a00007.c
*
* Description: rainboy_rt
*
* Version: 1.0
* Created: 14:54:08
* Revision: None
* Compiler: gcc
*
* Author: rainboy (Mn), [email protected]
* Company: None
*
* ===================================================== ========================================================== ======
*/
# Include <stdio. h>
# Deprecision max 100
Char str1 [Max + 1], str2 [Max + 1];
Int N1 [Max + 1], N2 [Max + 1], N3 [Max + 1];
Int Lena, lenb, lenc;
Int I, J, K, L;
Int main (INT argc, const char * argv [])
{
Scanf ("% s", str1 );
Scanf ("% s", str2 );
Lena = strlen (str1); lenb = strlen (str2 );
For (I = 1; I <= Lena; I ++ ){
N1 [Lena-I + 1] = str1 [I-1]-48; // high in the back, low in the front
}
For (I = 1; I <= lenb; I ++ ){
N2 [lenb-I + 1] = str2. [I-1]-48;
}
I = 1; j = 0;
While (I <= Lena) | (I <= lenb )){
N3 [I] = n2 [I] + N1 [I] + J;
J = N3 [I]/10;
N3 [I] = N3 [I] % 10;
I ++;
}
If (j> 0 ){
Lenc = I;
N3 [I] = J;
}
Else
Lenc = I-1;
For (I = lenc; I> 0; I --){
Printf ("% d", N3 [I]);
}
Return 0;
}