mathematica program

could anyone write this program in mathematica?
I would be grateful..

main(){
char s[300],t[300];
int i,j,c,m,n,edit;
int a[301][301];


printf("give s: ");
scanf("%s",s);
printf("give t: ");
scanf("%s",t);
m=strlen(s);
n=strlen(t);


else{




for(i=0;i<=m;i++){
a[i][0]=i; }
for(j=1;j<=n;j++){
a[0][j]=j; }
for(i=1;i<=m;i++){
for(j=1;j<=n;j++){
if(s[i-1]==t[j-1])
c=0;
else c=1;

a[i][j]=min(a[i-1][j]+1,min(a[i][j-1]+1,a[i-1][j-1]+c));
edit=a[i][j];

}
}

}
}
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories