/*字符串
000ABCD0AB0120000300ABC00
删除数字前面的零和其余重复的零
如:
以上删除后为
0ABCD0AB120000300ABC0
#include "stdio.h"
#include "string.h"
int main(int argc, char* argv[])
{
char a[100] ="000ABCD0AB0120000300ABC00";
int i=0, count;
printf("%s\n\n",a);
while(a[i])
{
int flag = 0;
int flag1 = 0;
count = 0;
if(i== 0)
{
while(a[i]== '0')
{
i++;
}
if('0' < a[i] && a[i] < '9')
{
strcpy(a,a+i);
i = 1;
}
else
{
strcpy(a+1,a+i);
i=2;
}
}
while(a[i] != '0')
{
i++;
}
if('0'<a[i-1] && a[i-1] <= '9')
{
flag = 1;
}
while(a[i] == '0')
{
count++;
i++;
}
if('0'<a[i] && a[i] <= '9')
{
flag1 = 1;
}
if(flag == 0 && flag1 == 0)
{
strcpy(a+i-count+1, a+i);
i=i-count+2;
}
if(flag == 0 && flag1 == 1)
{
strcpy(a+i-count,a+i);
i=i - count+1;
}
}
printf("%s\n",a);
return 0;
}