Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: vachirasawin

Problemset: แปลงเลขฐาน

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-13 14:44:53

// grader-chan
// c1_bkk66_2.cpp | c1_bkk66_2

#include <bits/stdc++.h>
using namespace std;

int n, num;
stack<int> bi;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    scanf("%x", &n);

    num = n;
    while (num >= 1) {
        bi.push(num % 2);
        num /= 2;
    }
    while (!bi.empty()) {
        cout << bi.top();
        bi.pop();
    }
    cout << endl;

    printf("%o", n);

    return 0;
}