#include
#include
char s[128];
int main(){
printf("Input a binary number:");
gets(s);
int len,i,n=0;
len=strlen(s);
for (i=0; i
n<<=1;
n|=1;
}
else{
n<<=1;
}
}
printf("The number is %d in decimal.\n",n);
printf("The number is %o in octal.\n",n);
printf("The number is %X in octal.\n",n);
}