#include
#include
main()
{
int a[8], num, b[8];
clrscr();
printf("Introduce numero Decimal:"); scanf("%d",&num);
//INICIO//
if (num%2==0)
a[0]=num/2;
else
a[0]=(num-1)/2;
if (a[0]%2==0)
a[1]=a[0]/2; else a[1]=(a[0]-1)/2;
if (a[1]%2==0)
a[2]=a[1]/2; else a[2]=(a[1]-1)/2;
if (a[2]%2==0)
a[3]=a[2]/2; else a[3]=(a[2]-1)/2;
if (a[3]%2==0)
a[4]=a[3]/2; else a[4]=(a[3]-1)/2;
if (a[4]%2==0)
a[5]=a[4]/2; else a[5]=(a[4]-1)/2;
if (a[5]%2==0)
a[6]=a[5]/2; else a[6]=(a[5]-1)/2;
if (a[6]%2==0)
a[7]=a[6]/2; else a[7]=(a[6]-1)/2;
//BIN//
if (num%2==0)
b[0]=0; else b[0]=1;
if (a[0]%2==0)
b[1]=0; else b[1]=1;
if (a[1]%2==0)
b[2]=0; else b[2]=1;
if (a[2]%2==0)
b[3]=0; else b[3]=1;
if (a[3]%2==0)
b[4]=0; else b[4]=1;
if (a[4]%2==0)
b[5]=0; else b[5]=1;
if (a[5]%2==0)
b[6]=0; else b[6]=1;
if (a[6]%2==0)
b[7]=0; else b[7]=1;
//IMPRIMIR//
printf("%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d",b[7],b[6],b[5],b[4],b[3],b[2],b[1],b[0]);
getch();
}
A Greek town with natural aquifers on the sea shore Therma Ikaria
-
On the Greek island of Ikaria there isn't just quietness, life span (it is
one of the longest-lived spots on earth), communities, and shrouded sea
shores t...
Hace 4 años