Problem2210--Prefix and postfix operators overload

2210: Prefix and postfix operators overload

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

Consider the class definition: class IntPair { int first; int second; public: IntPair(int firstValue, int secondValue); // prefix operator++ here // postfix operator ++ here int getFirst( ) const; int getSecond( ) const; }; Give declarations and definitions for prefix and postfix versions of operator++.

Input

Given two positive integer a , b

Output

The prefix is: ( a+1 , b+1 ) The postfix is: ( a , b )

Sample Input Copy

8 8

Sample Output Copy

The prefix is: ( 9 , 9 )
The postfix is: ( 8 , 8 )

Source/Category

31