首页上一页 1  下一页尾页 1 条记录 1/1页
        老师:输入任意三个数,要输出最大的数,我的编写存在什么问题,是不是if只能判断a>b,而不能判断a>b>c?
                 	
                        发表在C语言视频课程答疑
                        2017-01-01                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    #include<stdio.h>
int main()
{
int a,b,c;
printf("请输入三个数据:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b>c)
{
printf("the max one is a: %d\n",a);
}
else if(a>c>b)
{
printf("the max one is a: %d\n",a);
}
else if(b>a>c)
{
printf("the max one is b: %d\n",b);
}
else if(b>c>a)
{
printf("the max one is b: %d\n",b);
}
else
{
printf("the max one is c: %d\n",c);
}
return 0;
}

 
	
                                                 VIP会员
VIP会员 购物车
购物车


 私信
                         私信 
                     
					 发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
                    
 
                







 
                     
                     
					 
						 
						 
						 
						