16进制转换练习
#include<iostream>
int main()
{
using namespace std;
int a;
for (int i=0 ; i <= 10; i++)
{
cout << "Please enter a number: " << endl;
cin >> a;
cout << "The Hex of " << a << " is " << hex << a << endl;
}
cout << "that's all"<<endl;
system("pause");
return 0;
}
循环时显示的a值有误,结果正确