s1をポップする: H s1をポップする: e s1をポップする: l s1をポップする: l s1をポップする: o s2をポップする: W s2をポップする: o s2をポップする: r s2をポップする: l s2をポップする: d
int main(){
complex c(3,4);
c.show();
cout << "real part is " << c.get_real() << "\n";
cout << "imaginary part is " << c.get_imaginary() << "\n";
cout << "norm is " << c.get_norm() << "\n";
return 0;
}
[実行結果]
3+4i
real part is 3
imaginary part is 4
norm is 5
|