提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
编写一个显示两个数字的程序
public class Main { public static void main(String[] arguments) { float number1 = 15;/* 来 自 时 代 J a v a 公 众 号 - nowjava.com*/ float number2 = 6; float result = number1 / number2; float remainder = number1 % number2; System.out.println(number1 + " divided by " + number2); System.out.println("\nResult\tRemainder"); System.out.println(result + "\t" + remainder); } }