#include <cstdio>
#include <cstdlib>
template <class T>
class number {
public:
T x;
T y;
number (int a, int b){
x=a; y=b;}
int add (T&);
T greater ();
};
template <class T>
int number<T>::add (T& rezAdd){
rezAdd = x+y;
return 1;
}
template <class T>
T number<T>::greater (){
return x>y? x : y;
}
int main (int argc, char **argv) {
int aux;
number<int> c(3,5);
c.add(aux);
printf ("number added [%d]\n", c.add(aux));
printf ("greater number: [%d]\n", c.greater());
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGNzdGRsaWI+Cgp0ZW1wbGF0ZSA8Y2xhc3MgVD4KY2xhc3MgbnVtYmVyIHsKcHVibGljOgogICAgVCB4OwogICAgVCB5OwoKICAgIG51bWJlciAoaW50IGEsIGludCBiKXsKICAgICAgICB4PWE7IHk9Yjt9CiAgICBpbnQgYWRkIChUJik7CiAgICBUIGdyZWF0ZXIgKCk7Cn07Cgp0ZW1wbGF0ZSA8Y2xhc3MgVD4KaW50IG51bWJlcjxUPjo6YWRkIChUJiByZXpBZGQpewogICAgcmV6QWRkID0geCt5OwogICAgcmV0dXJuIDE7Cn0KCnRlbXBsYXRlIDxjbGFzcyBUPgpUIG51bWJlcjxUPjo6Z3JlYXRlciAoKXsKICAgICAgICByZXR1cm4geD55PyB4IDogeTsKfQoKCmludCBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpIHsKICAgIGludCBhdXg7CiAgICBudW1iZXI8aW50PiBjKDMsNSk7CgogICAgYy5hZGQoYXV4KTsKICAgIHByaW50ZiAoIm51bWJlciBhZGRlZCBbJWRdXG4iLCBjLmFkZChhdXgpKTsKICAgIHByaW50ZiAoImdyZWF0ZXIgbnVtYmVyOiBbJWRdXG4iLCBjLmdyZWF0ZXIoKSk7CgogICAgcmV0dXJuIDA7Cn0=