test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
59
.config/Code/User/History/1591c2fd/07LV.cpp
Normal file
59
.config/Code/User/History/1591c2fd/07LV.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int getReal(){
|
||||
return real;
|
||||
}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
// res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
return a + c.getReal();
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/0HVy.cpp
Normal file
46
.config/Code/User/History/1591c2fd/0HVy.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, 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;
|
||||
}
|
64
.config/Code/User/History/1591c2fd/2KuS.cpp
Normal file
64
.config/Code/User/History/1591c2fd/2KuS.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c){
|
||||
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/4aqs.cpp
Normal file
46
.config/Code/User/History/1591c2fd/4aqs.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&, Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, 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;
|
||||
}
|
65
.config/Code/User/History/1591c2fd/50Xs.cpp
Normal file
65
.config/Code/User/History/1591c2fd/50Xs.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
friend Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
Complex operator++(Complex& c){
|
||||
c.real++;
|
||||
c.img++;
|
||||
return c;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/1591c2fd/6Eq8.cpp
Normal file
50
.config/Code/User/History/1591c2fd/6Eq8.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
58
.config/Code/User/History/1591c2fd/6yP9.cpp
Normal file
58
.config/Code/User/History/1591c2fd/6yP9.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
44
.config/Code/User/History/1591c2fd/7TPo.cpp
Normal file
44
.config/Code/User/History/1591c2fd/7TPo.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
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&, Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, 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;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/9Q03.cpp
Normal file
46
.config/Code/User/History/1591c2fd/9Q03.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;
|
||||
}
|
41
.config/Code/User/History/1591c2fd/A1Oh.cpp
Normal file
41
.config/Code/User/History/1591c2fd/A1Oh.cpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
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;
|
||||
}
|
56
.config/Code/User/History/1591c2fd/Cby0.cpp
Normal file
56
.config/Code/User/History/1591c2fd/Cby0.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/DD8E.cpp
Normal file
46
.config/Code/User/History/1591c2fd/DD8E.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, 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;
|
||||
}
|
48
.config/Code/User/History/1591c2fd/FiOr.cpp
Normal file
48
.config/Code/User/History/1591c2fd/FiOr.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
Complex c3 = c1 + c2 + c4;
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/G0P3.cpp
Normal file
46
.config/Code/User/History/1591c2fd/G0P3.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&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, 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;
|
||||
}
|
60
.config/Code/User/History/1591c2fd/GGA4.cpp
Normal file
60
.config/Code/User/History/1591c2fd/GGA4.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
59
.config/Code/User/History/1591c2fd/HYmA.cpp
Normal file
59
.config/Code/User/History/1591c2fd/HYmA.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int getReal(){
|
||||
return real;
|
||||
}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
return a + c.getReal();
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
Complex c3 = c1 + c2 + c4;
|
||||
// int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
63
.config/Code/User/History/1591c2fd/JjVT.cpp
Normal file
63
.config/Code/User/History/1591c2fd/JjVT.cpp
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
friend Complex operator++(Complex &c){}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
Complex operator++(Complex& c){
|
||||
c.real++;
|
||||
c.img++;
|
||||
return c;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
67
.config/Code/User/History/1591c2fd/JoRl.cpp
Normal file
67
.config/Code/User/History/1591c2fd/JoRl.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
48
.config/Code/User/History/1591c2fd/KcUu.cpp
Normal file
48
.config/Code/User/History/1591c2fd/KcUu.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
Complex c3 = c1 + c2;
|
||||
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/1591c2fd/LuKu.cpp
Normal file
62
.config/Code/User/History/1591c2fd/LuKu.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
60
.config/Code/User/History/1591c2fd/MZf2.cpp
Normal file
60
.config/Code/User/History/1591c2fd/MZf2.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
return *this;
|
||||
real++;
|
||||
img++;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
55
.config/Code/User/History/1591c2fd/NHr3.cpp
Normal file
55
.config/Code/User/History/1591c2fd/NHr3.cpp
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
return a + c.real;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
52
.config/Code/User/History/1591c2fd/NkEo.cpp
Normal file
52
.config/Code/User/History/1591c2fd/NkEo.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/1591c2fd/PFJb.cpp
Normal file
50
.config/Code/User/History/1591c2fd/PFJb.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
59
.config/Code/User/History/1591c2fd/RMJJ.cpp
Normal file
59
.config/Code/User/History/1591c2fd/RMJJ.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int getReal(){
|
||||
return real;
|
||||
}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
// res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
return a + c.getReal();
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
59
.config/Code/User/History/1591c2fd/RT7H.cpp
Normal file
59
.config/Code/User/History/1591c2fd/RT7H.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int getReal(){
|
||||
return real;
|
||||
}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
return a + c.getReal();
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/1591c2fd/THab.cpp
Normal file
50
.config/Code/User/History/1591c2fd/THab.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
47
.config/Code/User/History/1591c2fd/TLu3.cpp
Normal file
47
.config/Code/User/History/1591c2fd/TLu3.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
cout<<c1;
|
||||
|
||||
return 0;
|
||||
}
|
55
.config/Code/User/History/1591c2fd/UU5h.cpp
Normal file
55
.config/Code/User/History/1591c2fd/UU5h.cpp
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
int operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res.real;
|
||||
}
|
||||
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int operator+(int a, Complex c){
|
||||
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
// Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/UWa7.cpp
Normal file
46
.config/Code/User/History/1591c2fd/UWa7.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&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, 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);
|
||||
|
||||
cout<<c1;
|
||||
|
||||
return 0;
|
||||
}
|
37
.config/Code/User/History/1591c2fd/WA3W.cpp
Normal file
37
.config/Code/User/History/1591c2fd/WA3W.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/1591c2fd/YetN.cpp
Normal file
50
.config/Code/User/History/1591c2fd/YetN.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
Complex c3 = c1 + c2 + c4;
|
||||
int c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
44
.config/Code/User/History/1591c2fd/a2lR.cpp
Normal file
44
.config/Code/User/History/1591c2fd/a2lR.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
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&, Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
|
||||
out<<"Real Part: "<<c.real;
|
||||
out<<"Real Part: "<<c.real;
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
44
.config/Code/User/History/1591c2fd/bH6b.cpp
Normal file
44
.config/Code/User/History/1591c2fd/bH6b.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
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&, Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
|
||||
out<<"Real Part: "<<c.real;
|
||||
out<<"Real Part: "<<c.img;
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
64
.config/Code/User/History/1591c2fd/eR6N.cpp
Normal file
64
.config/Code/User/History/1591c2fd/eR6N.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c){
|
||||
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
1
.config/Code/User/History/1591c2fd/entries.json
Normal file
1
.config/Code/User/History/1591c2fd/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Untitled-1.cpp","entries":[{"id":"MZf2.cpp","timestamp":1711428527095},{"id":"GGA4.cpp","timestamp":1711428544410},{"id":"je48.cpp","timestamp":1711428663767},{"id":"LuKu.cpp","timestamp":1711428706516},{"id":"JoRl.cpp","timestamp":1711428830112},{"id":"eR6N.cpp","timestamp":1711428864910},{"id":"2KuS.cpp","timestamp":1711428935788},{"id":"vGW1.cpp","timestamp":1711428952962},{"id":"fQ2R.cpp","timestamp":1711429235320},{"id":"vLVu.cpp","timestamp":1711429279810},{"id":"qDbD.cpp","timestamp":1711429303510},{"id":"50Xs.cpp","timestamp":1711429342954},{"id":"JjVT.cpp","timestamp":1711429381524},{"id":"oHMq.cpp","timestamp":1711429482590},{"id":"Cby0.cpp","timestamp":1711429511760},{"id":"6yP9.cpp","timestamp":1711429536487},{"id":"mShu.cpp","timestamp":1711429663500},{"id":"lpTN.cpp","timestamp":1711429681253},{"id":"wss7.cpp","timestamp":1711429694826},{"id":"A1Oh.cpp","timestamp":1711600360807},{"id":"ytN6.cpp","timestamp":1711600372169},{"id":"WA3W.cpp","timestamp":1711600391778},{"id":"a2lR.cpp","timestamp":1711600493890},{"id":"bH6b.cpp","timestamp":1711600545827},{"id":"7TPo.cpp","timestamp":1711600558060},{"id":"lwSd.cpp","timestamp":1711600654335},{"id":"4aqs.cpp","timestamp":1711600666747},{"id":"DD8E.cpp","timestamp":1711600696414},{"id":"0HVy.cpp","timestamp":1711600730623},{"id":"9Q03.cpp","timestamp":1711600761809},{"id":"BJQh.cpp","timestamp":1711600803437},{"id":"quUX.cpp","timestamp":1711600852247},{"id":"G0P3.cpp","timestamp":1711600863738},{"id":"UWa7.cpp","timestamp":1711600876773},{"id":"kFrd.cpp","timestamp":1711600993010},{"id":"TLu3.cpp","timestamp":1711601149904},{"id":"KcUu.cpp","timestamp":1711601175858},{"id":"FiOr.cpp","timestamp":1711601188353},{"id":"ndeV.cpp","timestamp":1711601200842},{"id":"YetN.cpp","timestamp":1711601311970},{"id":"THab.cpp","timestamp":1711601370681},{"id":"PFJb.cpp","timestamp":1711601388316},{"id":"6Eq8.cpp","timestamp":1711601456597},{"id":"NkEo.cpp","timestamp":1711601488287},{"id":"UU5h.cpp","timestamp":1711601530867},{"id":"NHr3.cpp","timestamp":1711601553888},{"id":"RT7H.cpp","timestamp":1711601589329},{"id":"07LV.cpp","timestamp":1711601613996},{"id":"RMJJ.cpp","timestamp":1711601735672},{"id":"HYmA.cpp","timestamp":1711616456669}]}
|
67
.config/Code/User/History/1591c2fd/fQ2R.cpp
Normal file
67
.config/Code/User/History/1591c2fd/fQ2R.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){
|
||||
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
Complex operator++(Complex const& c){
|
||||
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
61
.config/Code/User/History/1591c2fd/je48.cpp
Normal file
61
.config/Code/User/History/1591c2fd/je48.cpp
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
42
.config/Code/User/History/1591c2fd/kFrd.cpp
Normal file
42
.config/Code/User/History/1591c2fd/kFrd.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
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&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
cout<<c1;
|
||||
|
||||
return 0;
|
||||
}
|
66
.config/Code/User/History/1591c2fd/lpTN.cpp
Normal file
66
.config/Code/User/History/1591c2fd/lpTN.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
// setter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/lwSd.cpp
Normal file
46
.config/Code/User/History/1591c2fd/lwSd.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&, Complex);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, 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;
|
||||
}
|
62
.config/Code/User/History/1591c2fd/mShu.cpp
Normal file
62
.config/Code/User/History/1591c2fd/mShu.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
49
.config/Code/User/History/1591c2fd/ndeV.cpp
Normal file
49
.config/Code/User/History/1591c2fd/ndeV.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator+(Complex c){
|
||||
Complex res;
|
||||
res.real = real + c.real;
|
||||
res.img = img + c.img;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
friend ostream& operator<<(ostream&, Complex&);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Complex& c){
|
||||
out<<c.real<<"+"<<c.img<<"i\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
Complex c4(2, 3);
|
||||
|
||||
Complex c3 = c1 + c2 + c4;
|
||||
cout<<c3;
|
||||
|
||||
return 0;
|
||||
}
|
53
.config/Code/User/History/1591c2fd/oHMq.cpp
Normal file
53
.config/Code/User/History/1591c2fd/oHMq.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
friend Complex operator++(Complex &c){}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
Complex operator+(Complex const& c1, Complex const& c2){}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
65
.config/Code/User/History/1591c2fd/qDbD.cpp
Normal file
65
.config/Code/User/History/1591c2fd/qDbD.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
friend Complex operator++(Complex const &c){
|
||||
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
Complex operator++(Complex const& c){
|
||||
c.real++;
|
||||
c.img++;
|
||||
return *this;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/1591c2fd/quUX.cpp
Normal file
46
.config/Code/User/History/1591c2fd/quUX.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;
|
||||
}
|
64
.config/Code/User/History/1591c2fd/vGW1.cpp
Normal file
64
.config/Code/User/History/1591c2fd/vGW1.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){
|
||||
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
63
.config/Code/User/History/1591c2fd/vLVu.cpp
Normal file
63
.config/Code/User/History/1591c2fd/vLVu.cpp
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
friend Complex operator++(Complex const &c){
|
||||
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
friend Complex operator+(Complex const& c1, Complex const& c2){}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
Complex operator+(Complex const& c1, Complex const& c2){
|
||||
Complex res;
|
||||
res.real = c1.real + c2.real;
|
||||
res.img = c1.img + c2.img;
|
||||
return res;
|
||||
}
|
||||
Complex operator++(Complex const& c){
|
||||
|
||||
}
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
66
.config/Code/User/History/1591c2fd/wss7.cpp
Normal file
66
.config/Code/User/History/1591c2fd/wss7.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
// setter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Complex operator++(int){
|
||||
Complex temp(*this);
|
||||
real++;
|
||||
img++;
|
||||
return temp;
|
||||
}
|
||||
Complex operator++(){
|
||||
real++;
|
||||
img++;
|
||||
return *this;
|
||||
}
|
||||
Complex operator--(int){
|
||||
Complex temp(*this);
|
||||
real--;
|
||||
img--;
|
||||
return temp;
|
||||
}
|
||||
Complex operator--(){
|
||||
real--;
|
||||
img--;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
Complex c3 = c1++;
|
||||
c1.print();
|
||||
c3.print();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
41
.config/Code/User/History/1591c2fd/ytN6.cpp
Normal file
41
.config/Code/User/History/1591c2fd/ytN6.cpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
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){}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void print(){
|
||||
cout<<real<<" + i"<<img<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
Complex operator++(Complex &c){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Complex c1(1, 2);
|
||||
Complex c2(2, 3);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue