public static int[] reDiv(int a,int b){
//不能用除法,要求计算出商 和 余数
int [] arr = new int[2];
int quotient = 0;
int remainder = 0;
while(a>=b){
a = a-b;
quotient++;
}
remainder = a;
arr[0] = quotient;
arr[1] = remainder;
return arr;
}
标签:arr,int,出商,余数,除法,remainder,quotient
From: https://www.cnblogs.com/hack2xia/p/16917215.html