第二章第七题

来源:互联网 发布:深入理解linux 编辑:程序博客网 时间:2024/06/06 02:20
#include<stdio.h>
int main()
{
 int x,y,z;
 scanf ("%c%c",&x,&y);
 z=y-x;
 if (z%2 == 0)
 {
  if (x>y)
   printf("%c\n",x+1);
  else
   printf("%c\n",y+1);
 }
 else
 {
  if (x>y)
   printf("%c\n",y-1);
  else
   printf("%C\n",x-1);
 }
 return 0;
}
0 0
原创粉丝点击