文章

74

粉丝

0

获赞

206

访问

13.0k

头像
八进制 题解:
P1417 华中科技大学机试题
发布于2026年2月1日 10:14
阅读数 142

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

void change(int x) {
	vector<int> q;
	while (x) {
		q.push_back(x % 8);
		x /= 8;
	}
	reverse(q.begin(),q.end());
	for (auto c : q) cout << c;
	cout << endl;
}

int main() {
	int x;
	while (cin >> x) {
	    change(x);
	}

	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发