rs[102],t[102];intl,i,x,y;charb,v;b='u';v='u';intz;z=0;printf("\t\t\t请您输入数据:\n\t\t\t");scanf("%s",s);l=strlen(s);for(i=0;i<l;i++){if(s[i]=='1'){z=0;if(b=='u')b='m';elseb='u';t[i]=b;}else{z++;if(z<4)t[i]='0';elseif(z==4){z=0;if(v=='u')v='m';elsev='u';t[i]=v;if(b!=v){t[i-3]=t[i];b=v;}}}}t[i]='\0';printf("\t\t\tHDB3编码为:\n\t\t\t");printf("%s\n",t);getch();initgraph(1000,500);//这里和TC略有区别,,图形分辨率chars1[]="Inputis:";outtextxy(100,50,s1);//在指定位置显示字符串for(i=0;i<l;i++){x=100;//从x=100开始x=x+i*50;//i(x)坐标if(s[i]=='0'){y=200;line(x,y,x+50,y);}//列if(s[i]=='1'){y=100;line(x,y,x+50,y);}}chars2[]="Outputis:";outtextxy(100,250,s2);for(i=0;i<l;i++){x=100;x=x+i*50;if(t[i]=='0'){y=400;line(x,y,x+50,y);}else{if(t[i]=='u'){y=350;line(x,y,x+50,y);}else{y=450;line(x,y,x+50,y);}}}getch();//按任意键继续closegraph();//关闭图形界面}