UOJ#1 A+B Problem

最后一题???

打好读入优化8

# include 
# include 

class InputStream  {
    public :
        template < class T >
            inline InputStream& operator >> ( T& x )  {
                bool neg ( 0 ) ;
                register int c ;
                while ( isspace ( c = getchar ( ) ) && c != 45 ) ;
                if ( c == 45 )  neg = 1, c = getchar ( ) ;
                for ( x = 48 ^ c ; isdigit ( c = getchar ( ) ) ; ( x *= 10 ) += c ^ 48 ) ;
                return *this ;
            }
} cin ;

class OutputStream  {
    private :
        int tp ;
        char st [20] ;  
    public :
        template < class T >
            inline OutputStream& operator << ( register T x )  {                
                if ( x == 0 )  {
                    putchar ( 48 ) ;
                }  else  {
                    if ( x < 0 )  putchar ( 45 ), x = -x ;
                    while ( x )  st [++ tp] = x % 10, x /= 10 ;
                    while ( tp )  putchar ( st [tp --] + 48 ) ;
                }
                return *this ;
            }
            inline OutputStream& operator << ( char c )  {
                putchar ( c ) ;
                return *this ;
            }
} cout ;

# define debug(...) fprintf( stderr, __VA_ARGS__ )

int main ( )  {
    int a, b ;
    cin >> a >> b ;
    cout << a + b << '\n' ;
    return 0 ;
}

你可能感兴趣的:(UOJ#1 A+B Problem)