为什么a不递增啊
#include<stdio.h>#include<string.h>
main(){
char sw[100];
printf("请输入无符号数:\n");
scanf("%S",sw);
strcat(sw,"$");
int a,b,c,d,e,f;//计数,错误标志
char ai;char at;
a=b=c=d=e=f=0;
while(sw[a]!='$'){
ai=sw[a];
at=sw[a+1];
if(ai>='0' && ai<='9')
{ e=1;
if((at>='0' && at<='9') || at=='.' || at=='e'||at=='$' )
{
b=1;
}
else
{
b=0;}
}
if(ai=='.'){
c++;
if(at>='0'&&at<='9'||at=='$'||at=='e')
{
b=1;
}
else
{
b=0;}
}
if(ai=='e')
{
d++;
if(at>='0' && at<='9'&&(c==1||e==1)||at=='+'||at=='-'||at=='$'){
b=1;
if(at=='+'||at=='-'){
f++;
if(at>='0' && at<='9'||at=='$')
{
b=1;
}
else
{
b=0;}
}
}
}
a++;
}
if(b==1&&c<=1&&d<=1&&f<=1)
printf("输入正确%d %d",a,b);
else
printf("输入错误%d %d",a,b);
}
//请输入无符号数:
//345678
//输入正确1 1