满意答案
#include "stdio.h"
#include "conio.h"
main()
{ int i,j,k;
char a[]="abcdefghigklmnopqrstuvwxyz" ;
char str[100];
char c[126];
char b[126];
printf("shurukey:\n");
gets(str);
strcat(str,(const char *)a);
printf("%s\n",str);
for(i=strlen(str)-1;i>=0;i--)
for(j=strlen(str)-1;j>=0;j--)
{
if(i!=j&&str[i]==str[j])
{
for(k=i;k<=strlen(str)-1;i++)
str[i]=str[i-1];
}
}
printf("%s\n",str);
gets(b);
printf("shuru mingwen:") ;
for(i=1;i<=strlen(b);i++)
for(j=1;j<=26;j++)
if(b[i]==a[j])
{
for(k=0;;k++)
c[k]=j ;
}
printf("suode miwen shi:");
for(k=1;;k++)
{
printf("%c,",str[c[k]]);
}
getchar() ;
}
这个是我遍的,但是是死循环,可以帮我看一下吗?谢了
00分享举报