怎么用c++写,初学者,实在不理解

img

#include<iostream>
#include<sstream>
using namespace std;
......
    int decimal;
    stringstream ss;
    cout<<"Enter a decimal number:";
    cin>>decimal;
    /*下面两句等价于:
    cout<<"Convert to hex:"<<hex<<decimal<<endl;
    */
    //十进制转十六进制
    ss<<hex<<decimal;
    cout<<"Convert to hex:"<<ss.str()<<endl;