#include
#include
using namespace std;
double test(double& temp)
{
temp = 100;
return temp;
}
double test2(double a, double b)
{
return a + b;
}
int main()
{
double temp = 200;
cout<<"temp+test(temp)="<<temp+test(temp)<<endl;
temp = 200;
cout<<"temp+1+test(temp)="<<temp+1+test(temp)<<endl;
temp = 200;
cout<<endl<<"temp = "<<temp<<" , test()="<<test(temp)<<endl;
temp = 200;
cout<<endl<<"temp = "<<temp<<" 1="<<1<<" test()="<<test(temp)<<endl;
temp = 200;
cout<<"test = "<<test(temp)<<" , temp="<<temp<<endl;
cout<<"---------------------------- fengexian -----------"<<endl;
temp = 200;
cout<<"test()+temp="<<test(temp)+temp<<endl;
temp = 200;
cout<<"test2(temp, test(temp))="<<test2(temp,test(temp))<<endl;
temp = 200;
cout<<"test2(test(temp),temp)="<<test2(test(temp),temp)<<endl;
return 0;
}
Output: |