| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 362 人关注过本帖
标题:请看一下我这个类,有什么问题吗,总是出错!
取消只看楼主 加入收藏
锦芳
Rank: 2
等 级:论坛游民
帖 子:44
专家分:15
注 册:2013-3-1
结帖率:46.15%
收藏
已结贴  问题点数:20 回复次数:0 
请看一下我这个类,有什么问题吗,总是出错!
public class Number{
      void sort(int a,int b,int c){
          int count=0;
          int temp=0;
          if(b<a){
            temp=a;
            a=b;
            b=temp;
            count++;
            System.out.println(a,b,c);
            }
          if(c<a){
            temp=a;
            a=c;
            c=temp;
            count++;
            System.out.println(a,b,c);
            }
          if(b<c){
            temp=c;
            c=b;
            b=temp;
            count++;
            System.out.println(a,b,c);
            }
          if(count==0){
            System.out.println(a,b,c);
            }
         
          }
      }
这是一个排序的类,好像哪里出错了,但是我看不出,求各位大神指点

这是主类,没有问题
import java.util.Scanner;
public class Exam3_1{
      public static void main(String args[]){
          Scanner reader=new Scanner(System.in);
          System.out.println("Please input three number:");
          int x=reader.nextInt();
          int y=reader.nextInt();
          int z=reader.nextInt();
          Number number=new Number();
          number.sort(x,y,z);
          }
      }
搜索更多相关主题的帖子: public count 
2014-03-13 23:03
快速回复:请看一下我这个类,有什么问题吗,总是出错!
数据加载中...
 
   



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

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