65,210
社区成员
发帖
与我相关
我的任务
分享
template<class Type>
Type MInt(Type a)
{
return a;
}
template<class Type>
Type MInt(Type a, Type b)
{
return a * 1000 + b;
}
template<class Type>
Type MInt(Type a, Type b, Type c)
{
return MInt(a, b) * 1000 + c;
}
template<class Type>
Type MInt(Type a, Type b, Type c, Type d)
{
return MInt(MInt(a, b) * 1000, c) * 1000 + d;
}
int main(int argc, char* argv[])
{
//printf("DDD");
int c = MInt(10, 5);
int d = MInt(1, 2, 3);
int e = MInt(5, 6, 9, 55);
cout<< c << endl;
cout<< d << endl;
cout<< e << endl;
}