请为这段简单的java代码编写junit测试,我想借此理解一下junit
importjava.util.*;publicclassCompare{publicstaticvoidmain(String[]arg){inta,b,c,t;Sca...
import java.util.*;
public class Compare{
public static void main(String[] arg){
int a,b,c,t;
Scanner in = new Scanner(System.in);
System.out.printf("Please enter three numbers:");
a = in.nextInt();
b = in.nextInt();
c = in.nextInt();
if(a>b){
t=a;a=b;b=t;
}
if(b>c){
t=b;b=c;c=t;
}
if(a>c){
t=a;a=c;c=t;
}
System.out.print(a+" ");
System.out.print(b+" ");
System.out.print(c+" ");
}
} 展开
public class Compare{
public static void main(String[] arg){
int a,b,c,t;
Scanner in = new Scanner(System.in);
System.out.printf("Please enter three numbers:");
a = in.nextInt();
b = in.nextInt();
c = in.nextInt();
if(a>b){
t=a;a=b;b=t;
}
if(b>c){
t=b;b=c;c=t;
}
if(a>c){
t=a;a=c;c=t;
}
System.out.print(a+" ");
System.out.print(b+" ");
System.out.print(c+" ");
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询