test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
46
.config/Code/User/History/1591c2fd/BJQh.cpp
Normal file
46
.config/Code/User/History/1591c2fd/BJQh.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
class Complex{
|
||||
int real;
|
||||
int img;
|
||||
|
||||
public:
|
||||
|
||||
Complex(){}
|
||||
Complex(int real, int img) : real(real), img(img){}
|
||||
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, const Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, const Complex& c){
|
||||
|
||||
out<<"Real Part: "<<c.real<<endl;
|
||||
out<<"Imaginary Part: "<<c.img<<endl;
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue