-
程序参考:///345将4589467892356234752354防重复2364236442534645675756
public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a,b; for(int i=0; i<3; i++) { a=b=0; do { try { a=sc.nextInt(); b=sc.nextInt(); if (a==0 || b==0) throw new Exception(""); } catch(Exception e) { System.out.println("输入错,请重新输入!"); sc=new Scanner(System.in); } } while(a==0 || b==0); System.out.printf("%d/%d=%d\n",a,b,a/b); } }
如本站内容“对您有用”,欢迎随意打赏,让我们持续更新!
打赏