Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.0 kB
3
Indexable
Never
#include <stdio.h>
#include <locale.h>
#include <wchar.h>

int main() {
    setlocale(LC_CTYPE, "C.UTF-8");
    unsigned long long int num;
    wchar_t char1 = 0x4dc0;
    
    if(scanf("%llu", &num) != EOF) {
        int ndiv =0;
        unsigned long long int a = num;
        if (a==0)
        {   
            wprintf(L"%lc",char1);
            wprintf (L"%ls",L"\n");
            return 0;           
        }
        while (a!=0)//saber quantas vezes é divisivel
        {
            a /= 64; 
            ndiv++;
        }
        for(int i =ndiv-1; i>= 0;i--)//para depois usar aqui
        {
            unsigned long long int na = num >>(6*i);//58875÷2¹²,58875÷2⁶,58875÷2⁰ == 58875 >> 2^(6*2), 58875 >> 2^(6*1), 58875 >> 2^(6*0)  
            wchar_t char2 = char1+(na%64);                                                //14               23                59    
            wprintf(L"%lc",char2);
            if (i>0) 
            wprintf(L" ");
        
        }
        wprintf(L"\n");
    }
    return 0;
}
Leave a Comment