#include <stdio.h>

void main() {
    int decimal;
    scanf("%d", &decimal);

    if (decimal <= 255) {
        int result[] = {2, 2, 2, 2, 2, 2, 2, 2};
        int i = 0;

        while (decimal > 1) {
            result[i] = decimal % 2;

            if (result[i] == 1)
                decimal = (decimal - 1) / 2;
            else
                decimal /= 2;

            if (decimal < 2)
                result[i + 1] = decimal;

            i++;
        }

        i = 7;
        while (i >= 0) {
            if (result[i] != 2)
                printf("%d", result[i]);

            i--;
        }
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: