标签:
#include<iostream>
#include<string>
#include<complex>
using namespace std;
void main()
{
complex <int> num1(3, 4);
complex <float> num2(3.3, 4.5);
string str1("real is ");
string str2 = "imag is ";
cout << str1 << num1.real() << "," <<str2<< num1.imag() << endl;
cout << str1 << num2.real() << "," <<str2<< num2.imag() << endl;
}
运行结果:
end
标签:
原文地址:http://www.cnblogs.com/changbo/p/5304151.html