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