为什么编译时说xi和yi都是未说明的标识符,
为什么编译时说xi和yi都是未说明的标识符,
#include
using namespace std;
class imaginary
{
public:
\x05 imaginary(double a,double b)
\x05 {
\x05\x05 x=a;
\x05\x05 y=b;
\x05 }
\x05 friend imaginary add(imaginary &i1,imaginary &i2);
\x05 friend imaginary sub(imaginary &i1,imaginary &i2);
\x05 friend imaginary mul(imaginary &i1,imaginary &i2);
\x05 friend imaginary dev(imaginary &i1,imaginary &i2);
\x05 void show();
private:
\x05 double x,y,xi,yi;
};
imaginary add(imaginary &i1,imaginary &i2)
\x05 {
\x05\x05 i1.xi =i1.x+i2.x;
\x05\x05 i1.yi =i2.y+i1.y;
return i1;
\x05 }
\x05 imaginary sub(imaginary &i1,imaginary &i2)
\x05 {
\x05\x05 i1.xi=i1.x-i2.x;
\x05\x05 i1.yi=i1.y-i2.y;
\x05return i1;
\x05 }
\x05 imaginary mul(imaginary &i1,imaginary &i2)
\x05 {
\x05\x05 i1.xi=i1.x*i2.x-i1.y*i2.y;
\x05\x05 i1.yi=i1.x*i2.y+i1.y*i2.x;
\x05return i1;
\x05 }
\x05 imaginary dev(imaginary &i1,imaginary &i2)
\x05 {
\x05\x05 i1.xi=(i1.x*i2.x+i1.y*i2.y)/(i2.x*i2.x+i2.y*i2.y);
\x05\x05 i1.yi=(i1.y*i2.x-i1.x*i2.y)/(i2.x*i2.x+i2.y*i2.y);
return i1;
\x05 }
\x05 void show(){
\x05 if(yi
将void show(){
\x05 if(yi