#include <stdio.h>
#define MAX 100
#define CHANGE 1
char pass_char(char);
int main(int argc, char *argv[])
{
char ch[MAX];
int i;
printf("input a string:\n");
gets(ch);
#if CHANGE
for (i = 0;i <= strlen(ch);i++)
{
ch[i] = pass_char(ch[i]);
}
#endif
printf("the string is:\n");
puts(ch);
system("pause");
return 0;
}
char pass_char(char ch)
{
char c = ch;
if ((c >= 'a' && c < 'z') || (c >= 'A' && c < 'Z'))
{
c += 1;
}
else if ('z' == c || 'Z' == c)
{
c -= 25;
}
else
{
;
}
return c;
}
|