#include <iostream>
const int MAX_SIZE = 3;
class BigInt
{
public:
BigInt( const char *value );
friend std::ostream &operator<<( std::ostream &stm , const BigInt &bi );
private:
int value[ MAX_SIZE ];
};
BigInt::BigInt( const char *value )
{
for( int i = 0; i < MAX_SIZE; ++i )
{
//this->value[ i ] = -'0' + *value++;
this->value[ i ] = *value - '0';
++value;
}
}
std::ostream &operator<<( std::ostream &stm , const BigInt &bi )
{
for( int i = 0; i < MAX_SIZE; ++i )
{
stm << bi.value[ i ];
}
return( stm );
}
int main()
{
//char array[] = "123";
//const char* value = "123";
//BigInt bi1( value );
//BigInt bi1( array );
BigInt bi1( "123" );
std::cout << bi1 << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY29uc3QgaW50IE1BWF9TSVpFID0gMzsKCmNsYXNzIEJpZ0ludAp7CglwdWJsaWM6CglCaWdJbnQoIGNvbnN0IGNoYXIgKnZhbHVlICk7CglmcmllbmQgc3RkOjpvc3RyZWFtICZvcGVyYXRvcjw8KCBzdGQ6Om9zdHJlYW0gJnN0bSAsIGNvbnN0IEJpZ0ludCAmYmkgKTsKCXByaXZhdGU6CglpbnQgdmFsdWVbIE1BWF9TSVpFIF07Cn07CgpCaWdJbnQ6OkJpZ0ludCggY29uc3QgY2hhciAqdmFsdWUgKQp7Cglmb3IoIGludCBpID0gMDsgaSA8IE1BWF9TSVpFOyArK2kgKQoJewoJCS8vdGhpcy0+dmFsdWVbIGkgXSA9IC0nMCcgKyAqdmFsdWUrKzsKCQl0aGlzLT52YWx1ZVsgaSBdID0gKnZhbHVlIC0gJzAnOwoJCSsrdmFsdWU7Cgl9Cn0KCnN0ZDo6b3N0cmVhbSAmb3BlcmF0b3I8PCggc3RkOjpvc3RyZWFtICZzdG0gLCBjb25zdCBCaWdJbnQgJmJpICkKewoJZm9yKCBpbnQgaSA9IDA7IGkgPCBNQVhfU0laRTsgKytpICkKCXsKCQlzdG0gPDwgYmkudmFsdWVbIGkgXTsKCX0KCXJldHVybiggc3RtICk7Cn0KCmludCBtYWluKCkKewoJLy9jaGFyIGFycmF5W10gPSAiMTIzIjsKCS8vY29uc3QgY2hhciogdmFsdWUgPSAiMTIzIjsKCgkvL0JpZ0ludCBiaTEoIHZhbHVlICk7CgkKCS8vQmlnSW50IGJpMSggYXJyYXkgKTsKCUJpZ0ludCBiaTEoICIxMjMiICk7CglzdGQ6OmNvdXQgPDwgYmkxIDw8IHN0ZDo6ZW5kbDsKfQ==