标题:帮我看看那里错了
取消只看楼主
心若在
Rank: 1
等 级:新手上路
帖 子:82
专家分:0
注 册:2004-9-21
 问题点数:0 回复次数:1 
帮我看看那里错了

# include "stdio.h" main() { char a,b,x1,x2; printf("please input two word\n"); scanf("%c,%c",&a,&b); a=('a'<=x1<='z')?x1-32:x1; b=('a'<=x2<='z')?x2-32:x2; if('A'<=a<='Z'&&'A'<=b<='Z') printf("two is zhimu \n"); else if('A'<=a<='Z'&&'0'<=b<='9') printf("one is zhimu,one is shuzhi \n"); else if('0'<=a<='9'&&'A'<=b<='Z') printf("one is shuzhi,one is zhimu \n"); else if('0'<=a<='9'&&'0'<=b<='9') printf("two is shuzhi \n"); else printf("error \n"); getch(); }

我输入什么都只打印two is zhimu

搜索更多相关主题的帖子: one include please 
2004-09-22 14:35
心若在
Rank: 1
等 级:新手上路
帖 子:82
专家分:0
注 册:2004-9-21
得分:0 

是的啊 我只看了一天的书 菜是当然的啊

a=('a'<=x1<='z')?x1-32:x1;

这么写是对了啊 我调试过了

意思就是x1在是小写的字母就把它改成大写


我知道我菜 但我会尽我最大的努力去帮助别人!
2004-09-22 16:30



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




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

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