Java语法基础——运算符
摘要:
取余运算,取模运算——获取除法结果中的余数负数取余的结果:负数和0正数方向,n的余数是周期函数,并且小于n——工作中,周期性的运算经常采用%实现 1 public class Test { 2 public static void main(String[] args) { 3 int n = 5; 4 int m =n % 3;//5/3 得1余2 5 System.out.println("m = "+m); 6 7 System.out.println(-4%3); 8 System... 阅读全文
posted @ 2013-08-04 14:16 提子呀呀 阅读(237) 评论(0) 推荐(0)
浙公网安备 33010602011771号