标题:[求助]这又是哪里错了啊?
取消只看楼主
qxkjsha
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-2-25
 问题点数:0 回复次数:0 
[求助]这又是哪里错了啊?

输入两个字符,若这两个字符之差为偶数,则输出它们的后继字符,否则输出它们的前趋字符。这里的前趋和后继是指输入的两个字符中,较小字符前面的和较大字符后面的那个字符。 #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); }

}

搜索更多相关主题的帖子: character include please 
2005-10-26 08:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-31423-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.566317 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved