VC下写了一个
#include<stdio.h>
int main()
{
char ch;
int y=0;
while((ch=getchar())!='\n')
{
y=y*2+(ch-'0');
}
printf("%d",y);
return 0;
}
#include<stdio.h>
int main()
{
char ch;
int y=0;
while((ch=getchar())!='\n')
{
y=y*2+(ch-'0');
}
printf("%d",y);
return 0;
}