package suanfa;
/**
* 计算长方形个数
* 给:宽w,高h
* 求:宽和高组成的网络,总的长方形个数
*/
public class t1 {
public static void main(String[] args) {
long t = getCount(3,3);
System.out.println(t);//22
}
public static long getCount(int width, int heigh) {
long out = 0;
for(int i=1; i<=width; i++) {
for(int j=1; j<=heigh; j++) {
int k = i==j?0:(width-i+1)*(heigh-j+1);
out = out + k;
}
}
return out;
}
}