c++10进制转换为16进制题// Note:Your choice is C++ IDE#include using namespace std;int main(){int i,j,n=0;char k[20];char s[17]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};couti;while(i!=0){j=i%16;k[n]=s[j+1];j=j/16;n++;}cout

问题描述:

c++10进制转换为16进制题
// Note:Your choice is C++ IDE
#include
using namespace std;
int main()
{
int i,j,n=0;
char k[20];
char s[17]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
couti;
while(i!=0)
{
j=i%16;
k[n]=s[j+1];
j=j/16;
n++;
}
cout

修改如下:#include using namespace std;int main(){ int i,j,n=0; char k[20]; char s[17]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; couti; while(i!=0) { j=i%16; k[n]=s[j]...