早教吧作业答案频道 -->其他-->
为什么编译时说xi和yi都是未说明的标识符,#includeusingnamespacestd;classimaginary{public:\x05imaginary(doublea,doubleb)\x05{\x05\x05x=a;\x05\x05y=b;\x05}\x05friendimaginaryadd(imaginary&i1,imaginary&i2);\x05friendimagi
题目详情
为什么编译时说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
#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
\x05 if(yi
看了 为什么编译时说xi和yi都是...的网友还看了以下:
EXCEL求值问题外径\x05壁厚\x05长度支数\x05重量\x05单价价格\x0518\x05 2020-04-07 …
怎么在不同列和行的表格中将相同的名字筛选出来?张三\x05王红\x05麻子李四\x05李二\x05 2020-05-13 …
为什么编译时说xi和yi都是未说明的标识符,#includeusingnamespacestd;c 2020-05-19 …
总工时统计公式A,B,C班是8小时,H休息,每月从1号到31日计算每个员工一个月上多少工时?用什么 2020-06-11 …
这些加点的字怎么读啊?紧急!{点前面的字表示要注音}狭隘.\x05\x05拗.口\x05\x05秕 2020-06-23 …
下列符号中不属于转义字符的是A.\\\x05\x05\x05\x05B.\x05\x05\x05\ 2020-06-26 …
急:组成成语十\x05万\x05如\x05树\x05银\x05花\x05语火\x05急\x05星\ 2020-06-28 …
1:Hetriedtodistractattentionhisownillegalactiviti 2020-07-20 …
EXCEL函数的应用!A列\x05C列\x05\x05\x05汇总甲\x0515\x05\x05甲 2020-07-23 …
下列诗人在"安史之乱"期间写诗最少的是哪位?A.\x05\x05\x05\x05\x05\x05\x 2021-01-17 …