TC2.0輸入一個二進制數,輸出它的十進制,八進制和十六進制形式#include<stdio.h>main(){int c,d=0;for(;c=(putchar()!='\n');d=d*2+c-48);printf(%d\n%o\n%h\n",d,d,d);}
熱心網友
好!!!,如果再在前面加上提示,提醒只輸入0,1就更好了
TC2.0輸入一個二進制數,輸出它的十進制,八進制和十六進制形式#include<stdio.h>main(){int c,d=0;for(;c=(putchar()!='\n');d=d*2+c-48);printf(%d\n%o\n%h\n",d,d,d);}
好!!!,如果再在前面加上提示,提醒只輸入0,1就更好了