- 由给出的源代码和加密后的代码破译代码
- `#include<bits/stdc++.h>
using namespace std;
int main()
{
char a[101],b[101],c[101],s[101][1];
gets(a);
gets(b);
gets(c);
for(int i=0; i<strlen(a); i++)
{
for(int j=i+1; j<strlen(b); j++)
{
if(a[i]==a[j]&&b[i]!=b[j])
{
cout<<“Failed”;
return 0;
}
}
}
for(int i=0; i<strlen(b); i++)
{
for(int j=i+1; j<strlen(a); j++)
{
if(b[i]==b[j]&&a[i]!=a[j])
{
cout<<“Failed”;
return 0;
}
}
}
for(int i=0; i<strlen(a); i++)
{
s[a[i]][0]=b[i];//破译
}
for(int i=65; i<=90; i++)
{
if(!s[i][0])
{
cout<<“Failed”;
return 0;
}
}
for(int i=0; i<strlen©; i++)
{
c[i]=s[c[i]][0];//代换
}
for(int i=0; i<strlen©; i++)
{
cout<<c[i];
}
return 0;
}
`