太麻烦了,喜欢简单,利用三角形边运算, 我的MSN: zwx_yal@yahoo.com.cn public class Test { public static void main(String[] args) { for(int i=0;i<5;i++) { for(int j=0;j<5;j++){ boolean bl = (i+j < 5); int x = bl ? i:4-i; int y = bl ? j:4-j;
int m = 0; for(int n=0;n<=x+y;n++) m+= n; if((x+y)%2==0) { m+=y+1; } else { m+=x+1; } if(!bl) m = 26 - m;