{
cout << "请输入一个整数:" << endl;
int x = 0;
cin >> x;
//cout <<"二进制为:"<< bin << x << endl;为什么二进制bin未声明?
cout <<"八进制为:"<< oct << x << endl;
cout <<"十进制为:"<< dec << x << endl;
cout <<"十六进制为:"<< hex << x << endl;
//oct,dec,hex分别为8/10/16进制的英文缩写
}
return 0;
}
onemoo
相关分类