Repository navigation
Expand file tree
/
Copy pathool.cpp
More file actions
152 lines (135 loc) · 2.58 KB
/
Copy pathool.cpp
File metadata and controls
152 lines (135 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<exception>
using namespace std;
// class A{
// int x,y;
// public:
// A(){}
// A(int m,int n)
// {
// x=m;
// y=n;
// }
// // A operator+(A a){
// // A temp;
// // temp.x=x+a.x;
// // temp.y=y+a.y;
// // return temp;
// // }
// friend A operator+(A a,A i){
// A q;
// q.x=a.x+i.x;
// q.y=a.y+i.y;
// return q;
// }
// friend ostream & operator << (ostream& out,A & c){
// out<<c.x<<c.y;
// return out;
// }
// A operator+(int c){
// A temp;
// temp.x=x+c;
// temp.y=y+c;
// return temp;
// }
// // friend A operator+(int o,A &a){
// // A temp;
// // temp.x= a.x+o;
// // temp.y=a.y+o;
// // return temp;
// // }
// };
// int main(){
// int m,n;
// cin>>m>>n;
// A b(m,n);
// cin>>m>>n;
// A c(m,n);
// A d;
// d=b+c;
// cout<<d;
// d=2+d;
// cout<<d;
// }
// #include <iostream>
// using namespace std;
// //!
// class A {
// int x, y;
// public:
// A() {}
// A(int m, int n) {
// x = m;
// y = n;
// }
// A& operator=(const A& other) {
// if (this == &other) {
// return *this;
// }
// cout<<"call op";
// x = other.x;
// y = other.y;
// return *this;
// }
// friend ostream& operator<<(ostream& out, const A& c) {
// out << c.x << " " << c.y;
// return out;
// }
// };
// int main() {
// int m, n;
// cin >> m >> n;
// A a1(m, n);
// A a2;
// a2 = a1; // Using the overloaded assignment operator
// A a3=a1; //copy constructore will be call
// cout << a2 << endl;
// cout<<a3<<endl;
// return 0;
// }
// class A {
// int x;
// public:
// A(int val) : x(val) {}
// friend A operator=(A& obj){
// A val;
// obj.x = val.x;
// return val;
// }
// friend ostream& operator<<(ostream& out, const A& c) {
// out << c.x ;
// return out;
// }
// };
// int main() {
// A a1(10);
// A a2(20);
// a1=a2;
// cout<<a1<<endl;
// cout<<a2<<endl;
// return 0;
// }
class a{
float w,l;
public:
a(float x,float y){
w=x;
l=y;
}
operator float(){
return (float)w*l;
}
};
int main(){
float x,y;
cin>>x>>y;
a A(x,y);
float af;
af=A;
cout<<af;
}