#include <stdlib.h>
char GetChar();
void main()
{
char c='5';
char A,B,C,D,E,F;
int z=0;
for(;;)//A cirlce
{
c=GetChar();
switch(c)//A
{
case '1':
break;
case '0':
for(;;)//B cirle
{
c=GetChar();
switch(c)//B
{
case '0':
break;
case '1':
c=GetChar();
switch(c)//C
{
case '1':
C='1';
break;
case '0':
for(;;)//D circle
{
c=GetChar();
switch(c)//D
{
case '0':
B='0';
break;
case '1':
c=GetChar();//E
switch(c)
{
case '0':
E='0';
break;
case '1':
c=GetChar();//F
switch(c)
{
case '0':
z=1;
printf("z=%d\n",z);
printf("there is 010110.\n");
F='0';
break;
case '1':
F='1';
break;
}//F switch end
//if(F=='0'|F=='1')
// break;
break;
}//E switch end
if(E=='0'||F=='0'||F=='1')
{
break;
}
}//D switch end
if(B=='0'||F=='0'||F=='1')
{
break;
}
}//D cirlcle end
if(B=='0'||F=='0'||F=='1')
{
break;
}
}//C switch end
if(C=='1'||B=='0'||F=='0'||F=='1')
{
break;
}
}//B switch end
if(C=='1'||F=='1')
{
break;
}
}//B circle end
if(C=='1'||F=='1')
{
break;
}
}//A switch end
// printf("circle 1");
}//A circle end
return 0;
}
char GetChar()
{
char ch;
while(scanf("%c",&ch)==1)
{
if(ch!='\n'&&ch!=' '&&ch!='\t')
{
break;
}
}
return ch;
}
数字逻辑作业(第六章)
最新推荐文章于 2022-12-05 00:00:50 发布