注册 登录
编程论坛 JAVA论坛

教材程序,三个数比较大小, 什么地方出现有误

hdjtcmcn 发布于 2017-10-29 10:35, 2146 次点击
improt *;
public class CompIf{
pubic static void main(String args[]) throws IOException{
 int a,b,c,t;
 String str;
 BufferedReader buf;
 buf=new BufferedReader(new InputStreamReader(System.in));
 System.out.print("input sirst number:");
 str=buf.readLine();
 a=Integer.parseInt(str);
 System.out.print("input second number:");
 str=buf.readline();
 b=Integer.parseInt(str);
 System.out.print("input third number:");
 str=buf.readline();
 a=Integer.parseInt(str);
 if (a>b)
   {t=a;a=b;b=t;}
 if (a>c)
   {t=a;a=c;c=t;}
 if (b>c)
   {t=b;b=c;c=t;}
  System.out.print(a+",");
  System.out.print(b+",");
  System.out.print(c+",");
   
}
}
jdk8下调试
误在1、3行
2 回复
#2
kingpc5202017-10-29 14:02
仅仅比个大小为何我觉得写的这么复杂?
#3
feifeizkc2017-12-06 03:19
.你可是真逗,单词都可以写错,第一行的第一个单词应该是import,第三行的应该是public
1