Here is my code plz tell me where is the bug
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<ctype.h>
int main()
{
int i,x,y,k;
char a[100];
while(gets(a))
{
char b[4]={0};
int ln=strlen(a);
for(k=0;k<ln;)
{
if(isdigit(a[k]))
{
{
if((a[k]-'0')<3)
{
b[1]=a[k];
b[0]=a[k+1];
b[2]=a[k-1];
}
else
{
b[1]=a[k];
b[0]=a[k+1];
}
k=k+2;
}
x=atoi(b);
printf("%c",x);
}
else
{
x=a[k];
for(i=0;;i++)
{
y=x%10;
printf("%d",y);
x=x/10;
if(x==0)
break;
}
k++;
}
}
printf("\n");
}
return 0;
}
Why RE
Moderator: Board moderators
Why RE
I like to solve problems.