题解 | #进制转换#

进制转换

https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6

//还有stoi这个好用的用法,记录一下
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){
    string num_str;
    vector<int> storage;
    while(cin>>num_str)
        storage.push_back(stoi(num_str, 0, 16));
    for(auto num:storage)
        cout << num << endl;
}

全部评论

相关推荐

废物一个0offer:认真的吗二本本科找人工智能岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务