📜  流重载 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:52.948000             🧑  作者: Mango

代码示例1
// #include 
// #include
// using namespace std;
// auto start = chrono::steady_clock::now();

// int main(){
//     cout<<"My name is Devil"<(diff).count()<<" ms"<
// #include
// using namespace std;
// auto start = chrono::steady_clock::now();

// int main(){
    
//     cout<<"Hello how are u Akash kumar jiii"<(diff).count()<<"ms"<
#include
#include
using namespace std;
auto start = chrono::steady_clock::now();

class Person{
    string name;
    int age;
    public:    
        Person(){
            this->name = "No name";
            this->age = 0;
        }
        friend ostream &operator <<(ostream &output , Person &p);
        friend istream &operator >>(istream &input , Person &p);
};

ostream &operator <<(ostream &output , Person &p){
    output<<"Who is Devil "<>(istream &input , Person &p){
    cin>>p.name>>p.age;
    return input;
}

int main(){
    cout<<"Enter the name "<>ak;
    cout<(diff).count()<<" ms"<