文章

2

粉丝

493

获赞

2

访问

795

头像
进制转换2 题解:
P1259 北京大学机试题
发布于2024年9月13日 10:27
阅读数 189

使用c++的hex流

#include<iostream>
#include<sstream>
using namespace std;
int main() {
string s;
    while (cin>>s) {
        stringstream ss;
        ss << s;
        int t;
        ss >> hex >> t;
        cout << t << endl;
        ss.clear();
    }
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发