提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
Java的算术运算符
public class Main { public static void main(String[] args) { int a = 21, b = 6;//nowjava - 时 代 Java 提 供 int c = a + b; int d = a - b; int e = a * b; int f = a / b; int g = a % b; a++; b--; System.out.println(a + " and " + b); /* 来 自* NowJava.com - 时 代 Java */ } }