#include <stdio.h>
void main()
{
int i=0, j=0
char a[100] = {0}
scanf("%s",a)
while ('\0' != a[i])
{
a[i] += 4
if (a[i] >'z')
{
a[i] -= 26
}
else if (a[i] >'Z' &&a[i] <'e')
{
a[i] -= 26
}
++i
}
printf("%s",a)
}
验证无问题#include <iostream.h>
void main()
{
char Code[5]="LOVE"
char *p =new char [4]
int i = 0
while(Code[i] != '\0')
{
p[i] = Code[i]+3
cout<<p[i]
i++
}
cout<<endl
}
输出为:ORYH
Press any key to continue
评论列表(0条)