#include<stdio.h>
int bin[32];
int main()
{
int se,be,t,i,p,n;
//freopen("in.txt","r",stdin);
while(scanf("%d",&se)==1)
{
n=se,be=0;
for(i=31;i>=0;i--)
{
bin[i]=n&1;
n=n>>1;
}
for(i=3;i>=0;i--)
{
t=8*(i+1);
for(p=i*8;p<t;p++)
{
be=be<<1;
be=be|bin[p];
}
}
printf("%d converts to %d\n",se,be);
}
return 0;
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.