Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef STRUCT06_H_
- #define STRUCT06_H_
- #include <iostream>
- #include <string>
- #include <typeinfo>
- #include <cassert>
- using namespace std;
- ostream& operator<<(ostream& os, const complex& cp)
- {
- os << cp.real << " " << cp.imaginary;
- return os;
- }
- istream& operator>>(istream& is, complex& cp)
- {
- is >> cp.real >> cp.imaginary;
- return is;
- }
- inline void instruction(){
- complex cp1, cp2;
- cin >> cp1 >> cp2;
- cout << cp1 + cp2 << endl;
- cout << cp1 - cp2 << endl;
- cout << cp1 * cp2 << endl;
- cout << cp1 / cp2 << endl;
- }
- int main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int N;
- cin >> N;
- while(N--){
- instruction();
- }
- }
- #endif // STRUCT06_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement