#include <stdio.h>
#include <string.h>

char num[333335];
int two[1000000];

int main() {
    scanf("%s",num);
    if (!strcmp(num,"0")) {
            printf("0");
            return 0;
    }
    int len=strlen(num);
    for(int i=0; i<len; i++) {
        int n=num[i]-'0';
       for(int cnt=2; cnt>=0; cnt--) {
            two[3*i+cnt]=n%2;
            n/=2;
        } 
    }
    int flag=0;
    int l=strlen(num)*3;
    for(int i=0; i<l; i++) {
        if(two[i]==1) flag = 1;
        if(flag == 1) {
            printf("%d",two[i]);
        } 
    }
    return 0;
}

Embed on website

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