Toggle navigation
HUSTOJ
F.A.Qs
Web Board
ProblemSet
Source/Category
Status
Ranklist
Contest
Recent
Login
Problem2221--Operator overloading (Addition of complex numbers)
2221: Operator overloading (Addition of complex numbers)
Time Limit:
1 Sec
Memory Limit:
128 MB
Submit:
925
Solved:
0
[
Submit
] [
Status
] [
Web Board
] [Creator:
]
Description
Please create a class named Complex for performing complex number addition. You need to overload the input operator >>, the output operator <<, and the operator +.
Input
Given two positive complex numbers
Output
The calculation results
Sample Input
Copy
3 2 2 1
Sample Output
Copy
5+3i
Source/Category
56