首页 > 代码库 > P80

P80

#include<stdio.h>
#include<ctype.h>
char fun(char c)
{
	if(c>='A'&&c<='Z')
		c=c+32;
	if(c>='a'&&c<='u')
		c=c+5;
	else if(c>='v'&&c<='z')
		c=c-21;
	return c;
}
main()
{
	char c1,c2;
	printf("\nEnter a etter (A-Z):");
	c1=getchar();
	if(isupper(c1))
	{
		c2=fun(c1);
		printf("\n\nThe letter %c change to %c\n",c1,c2);
	}
	else
		printf("\nEnter (A-Z)!\n");
}