您的位置:首页 > 编程语言 > Java开发

java 算术运算符的应用

2016-03-11 23:02 309 查看
源程序:

public class Test{

 public static void main(String args[]){

  int x = 10 ;

  int y = 3 ;

  System.out.println(x + " + " +
y + " = " +(x + y)) ;

  System.out.println(x + " - " +
y + " = " +(x - y)) ;

  System.out.println(x + " * " +
y + " = " +(x * y)) ;

  System.out.println(x + " / " +
y + " = " +(x / y)) ;

  System.out.println(x + " % " +
y + " = " +(x % y)) ;

 }

}

运行结果:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: