死循环了,麻烦看一下题目是输入字符串删除相同字符
程序代码:
#include<stdio.h> #define changdu 80 void main() { char ch[changdu]; int num,b,c,e; gets(ch); lddp: e=1; for (num=0;num<(changdu);num++) { for (b=e;b<(changdu);b++) { if (ch[b]=='\0') goto loop; else if (ch[num]==ch[b]) { for(c=b;c<(changdu-1);c++) ch[c]=ch[c+1]; goto lddp; } } loop:e=e+1; } puts(ch); }