//templates what gets printed
#include <iostream>
using namespace std;
template <class T1, class T2>
int mystery(T1& a, T2 b, int c)
{
T1 t = a;
a = a + b;
return ( a - t + c);
}
int main(void)
{
int a = 3;
double b = 2.5;
int c = 1;
cout << " answer 1 is " << mystery(a, 2, c) << endl;
cout << " answer 2 is " << mystery(a, 1, c) << endl;
a = 5;
cout << " answer 3 is " << mystery(a, b, c) << endl;
a = 2;
b = 2.5;
cout << " answer 4 is " << mystery(a, b, b) << endl;
cout << " answer 5 is " << mystery(a,mystery(a, b, b),c)<< endl;
return 0;
}
Ly90ZW1wbGF0ZXMgd2hhdCBnZXRzIHByaW50ZWQKCiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZSA8Y2xhc3MgVDEsIGNsYXNzIFQyPgoKaW50IG15c3RlcnkoVDEmIGEsIFQyIGIsIGludCBjKQoKewoKVDEgdCA9IGE7CgphID0gYSArIGI7CgpyZXR1cm4gKCBhIC0gdCArIGMpOwoKfQoKaW50IG1haW4odm9pZCkKCnsKCmludCBhID0gMzsKCmRvdWJsZSBiID0gMi41OwoKaW50IGMgPSAxOwoKY291dCA8PCAiIGFuc3dlciAxIGlzICIgPDwgbXlzdGVyeShhLCAyLCBjKSA8PCBlbmRsOwoKY291dCA8PCAiIGFuc3dlciAyIGlzICIgPDwgbXlzdGVyeShhLCAxLCBjKSA8PCBlbmRsOwoKYSA9IDU7Cgpjb3V0IDw8ICIgYW5zd2VyIDMgaXMgIiA8PCBteXN0ZXJ5KGEsIGIsIGMpIDw8IGVuZGw7CgphID0gMjsKCmIgPSAyLjU7Cgpjb3V0IDw8ICIgYW5zd2VyIDQgaXMgIiA8PCBteXN0ZXJ5KGEsIGIsIGIpIDw8IGVuZGw7Cgpjb3V0IDw8ICIgYW5zd2VyIDUgaXMgIiA8PCBteXN0ZXJ5KGEsbXlzdGVyeShhLCBiLCBiKSxjKTw8IGVuZGw7CgpyZXR1cm4gMDsKCn0=