#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
int i1 = 100;
int i2;
string str1 = "111000";
string str2;
stringstream tmp;
//數字轉文字
tmp << i1;
tmp >> str2;
cout << "str2= " << str2 << endl;
tmp.clear(); //清空流
//文字轉數字
tmp << str1;
tmp >> i2;
cout << "i2= " << i2 << endl;
system("PAUSE");
return 0;
}