cout << "Hex(后面输出16进制):" << hex << 255 << endl;
cout << "Oct(后面输出8进制):" << oct << 255 << endl;
cout << "Dec(后面输出10进制):" << dec << 255 << endl;
16进制:255/16=15余15,15/16=0余15;(15)(15)=ff
8进制:255/8=31余7,31/8=3余7,3/8=0余3;377
欢迎分享,转载请注明来源:内存溢出
cout << "Hex(后面输出16进制):" << hex << 255 << endl;
cout << "Oct(后面输出8进制):" << oct << 255 << endl;
cout << "Dec(后面输出10进制):" << dec << 255 << endl;
16进制:255/16=15余15,15/16=0余15;(15)(15)=ff
8进制:255/8=31余7,31/8=3余7,3/8=0余3;377
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)