一、文件加密(encrypt)
对信息进行加密,可提高信息传输的安全性。正是由于它的重要用途,人们发明了各种各样的加密方式。其中一种方式是,对文中单词进行逆序处理。请你写一个程序,对已加密的文本进行解密。
输入输出样例:
输入:
2
eno owt eerht
i ekil siht emag
输出:
one two three
i like this game
#include<stdio.h>
typedef struct{
char ch[1000];
int length;
}SString;
SString s[50000];
int Decode()
{
// SString s[50000];
int a,b,N,i,j,k=0;
char cs[1000];
scanf("%d",&N);
if(N>50000) return 0;
for(j=0;j<N;j++)
{
b=0;
i=0;
cs[i++]=getchar();
cs[i]=getchar();
while(cs[i]!='\n')
{
if(cs[i]==' ')
{
for(a=i-1;a>=b;a--)
s[j].ch[k++]=cs[a];
s[j].ch[k++]=' ';
i++;
b=i;
cs[i]=getchar();
}
}
s[j].length=i;
}
return N;
}
void print(int n)
{
int i,j;
printf("\n");
for(j=0;j<n;j++)
{
for(i=0;i<s[j].length;i++)
{
printf("%c",s[j].ch[i]);
}
printf("\n");
}
}
void main()
{
int i;
i=Decode();
print(i);
}
这是我的程序求助有什么问题