View Code of Problem 105

#include<stdio.h>
#include<string.h>
int main()
{
int i,n,m,t,num=0,k=4;
char s[100],b[100];
while(gets(s)!="END")
{
scanf("%d",&t);
scanf("\n");
while(t--)
{
gets(b);
n=strlen(s);
m=strlen(b);
for(i=0;s[i]!='\0';)
{
if(s[i]==b[i])
i++;
else
break;
}
if(i==n&&m==n)
printf("%d OK!\n",++num);
if(i==n&&m>n)
{   if(s[n]==b[n+1])
	printf("%d %d delete %c\n",++num,n,b[n]);
     
}
if(i==n&&m>n)
{if(s[n]!=b[n+1])
	printf("%d %d delete %c\n",++num,n+1,b[n+1]);
}
if(i<n)
{
if(n>m)
{
printf("%d %d insert %c\n",++num,i+1,s[i]);

}
else if(n==m)
printf("%d %d change %c\n",++num,i+1,s[i]);
}
}

num=0;
}



}

Double click to view unformatted code.


Back to problem 105