#include<iostream.h>
template <class Ta,class Tb,class Tc>
Ta temp(const Ta &Cfist,const Tc &Cschar,const Tb &Clast)
{
Ta first=Cfist;
Tb last=Clast;
Tc fC=Cschar;
switch(fC)
{
case '+' :cout<< (ffisst+flast);
break;
case '-':cout<<(ffisst-flast);
break;
case '/' :cout<< (ffisst/flast);
break;
case '*' :cout<< (ffisst*flast);
break;
default : cout<<"Error!!!schar!!"<<endl;
}
}
int main()
{
int first;
int last;
char schar;
cout<<"Please input :"<<endl;
cout<<"first=";
cin>>first;
cout<<endl;
cout<<"schar=";
cin>>schar;
cout<<endl;
cout<<"last=";
cin>>last;
cout<<endl;
cout<<"The resurlt is:"<<first<<scahr<<last<<"="<<temp(first,schar,last)<<endl;
return 0;
}
有一个错误找不出来呀,,高手指点下啦!!