[求助]这又是哪里错了啊?
输入两个字符,若这两个字符之差为偶数,则输出它们的后继字符,否则输出它们的前趋字符。这里的前趋和后继是指输入的两个字符中,较小字符前面的和较大字符后面的那个字符。 #include "stdio.h" void main() { char a, b; int m; puts("please inpute two character!"); scanf("%c%c", &a,&b); if(a>b) m=a-b; else m=b-a; if(m%2==0) { printf("the next character of %c is: %c\n", a,a+1); printf("the next character of %c is: %c\n", b,b+1); } else { printf("the forward character of %c is: %c\n", a,a-1); printf("the forward character of %c is: %c\n", b,b-1); }
}