All pastes #53586 Raw Edit

Mine

public text v1 · immutable
#53586 ·published 2006-05-04 20:11 UTC
rendered paste body
public class MatrixConstructor{
	String[] arne;
	public String[] construct(int n,int m, int row, int col){
		arne = new String[n];
		int temp = 0;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < row; j++){
				if(arne[i] == null)arne[i] = i * row + j + " ";
				else arne[i] += i * row + j + " ";
				temp++;
			}
		}
		
		for(int i = 0;i < m - row; i ++){
			for(int j = 0; j < n; j++){
				arne[j] += temp + j + i * n + " ";
			}
		}
		return arne;
	}
			public static void main(String[] args) {
				MatrixConstructor leif = new MatrixConstructor();
				int n = 4;
				String[] arne = leif.construct(n,5,2,2);
				for(int i = 0; i < arne.length; i++){
					System.out.println(arne[i]);
				}
			}
		}