📄 12v.cpp
字号:
// cmath3.cpp A program to do complex math. Assumes
// Complex can be treated as any other simple numerical data type.
#include <iostream.h>
#include "complex3.h"
void main ()
{ char choice;
Complex a, b, c; // three Complex variables
cout << "enter a complex number pair: ";
cin >> a; // input cmplx into `a'
cout << "enter a complex number pair: ";
cin >> b; // input cmplx into `b'
cout << "enter choice: (a)dd, (s)ub, (m)ult: ";
cin >> choice; // get user's choice
switch (choice)
{ case 'a' : c = a + b; // add `b' to `a', assign to `c'
break;
case 's' : c = a - b; // sub `b' from `a'
break;
case 'm' : c = a * b; // mult `b' to `a'
break;
default : cout << "entry error";
}
cout << c; // display results.
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -