如下程序声明了一个电话号码类PhoneNumber,重载了流插入运算符<<,以便于电话号码的输出。请将程序补充完整。 #include<iostream> #include<iomanip> #include<string> using namespace std; class PhoneNumber{ public: void setNumber(string number){this->number=number;} friend______(ostream&output,const PhoneNumber&nuln) //重载流插入操作符 {output<<num.number;return output;} private: string number; }; int main( ){ PhoneNumber phone; phone.setNumber("8008100598"); cout<<"The phone number is:"<<phone<<endl: return 0; }
如下程序声明了一个电话号码类PhoneNumber,重载了流插入运算符<<,以便于电话号码的输出。请将程序补充完整。 #include<iostream> #include<iomanip> #include<string> using namespace std; class PhoneNumber{ public: void setNumber(string number){this->number=number;} friend______(ostream&output,const PhoneNumber&nuln) //重载流插入操作符 {output<<num.number;return output;} private: string number; }; int main( ){ PhoneNumber phone; phone.setNumber("8008100598"); cout<<"The phone number is:"<<phone<<endl: return 0; }
如下程序声明了一个电话号码类PhoneNumber,重载了流插入运算符<;<;,以便于电话号码的输出。请将程序补充完整。#include<;iostream>;#include<;iomanip>;#include<;string>;using namespace std;class PhoneNumber{public: void setNumber(string number){this->;number=number;}//重载流插入操作符 friend <;span style="text-decoration: underline;">; <;/span>;(ostream &output,const PhoneNumber &num) {output<;<;num.number;return output;}private: string number;};int main(){ PhoneNumber phone; phone.setNumber("8008100598"); cout<;<;"The phone number is:"<;<;phone<;<;endl; return 0;}
如下程序声明了一个电话号码类PhoneNumber,重载了流插入运算符<;<;,以便于电话号码的输出。请将程序补充完整。#include<;iostream>;#include<;iomanip>;#include<;string>;using namespace std;class PhoneNumber{public: void setNumber(string number){this->;number=number;}//重载流插入操作符 friend <;span style="text-decoration: underline;">; <;/span>;(ostream &output,const PhoneNumber &num) {output<;<;num.number;return output;}private: string number;};int main(){ PhoneNumber phone; phone.setNumber("8008100598"); cout<;<;"The phone number is:"<;<;phone<;<;endl; return 0;}