Untitled

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


int main()
{   
    setlocale(LC_CTYPE, "C.UTF-8");
    
    unsigned long long int n;
    wchar_t z;

    int q = 0;
    z = 0x4dc0;
    int i = 0;
    int aux[100] = {0};
    
   if(scanf("%llu", &n) != EOF) 
   {

    unsigned long long int a = n;
    if (a==0)
    {   
        wprintf(L"%lc", z);
        wprintf (L"%ls",L"\n");
        return 0;           
    }
    while (a != 0)//saber quantos valores ao certo vou ter inseridos na array 
    {     
        a /= 64;
        q++;
    }
    i = q; //para usar aqui
    while(n > 0) //para usar aqui no loop tbm
    {
        i--;
        aux[i] = (z+n%64);
        n /= 64;
        
    }      
    for(int j = 0; j < q;j++)//e aqui
    {
        if(j!=q-1)
        wprintf(L"%lc ", aux[j]);
        else 
        wprintf(L"%lc", aux[j]);
    }  
   }
  wprintf (L"%ls",L"\n");
  return 0;
}
Leave a Comment