martes, 19 de abril de 2011

Diagonal ( forma facil pero larga )

import java.util.*;
public class diagonal2
{
public static void main(String args[]){
int z[][]=new int [6][6];

z[0][0]=1;
System.out.print(z[0][0]);
z[0][1]=0;
System.out.print(z[0][1]);
z[0][2]=0;
System.out.print(z[0][2]);
z[0][3]=0;
System.out.print(z[0][3]);
z[0][4]=0;
System.out.print(z[0][4]);
z[0][5]=0;
System.out.println(z[0][5]);
z[1][0]=0;
System.out.print(z[1][0]);
z[1][1]=1;
System.out.print(z[1][1]);
z[1][2]=0;
System.out.print(z[1][2]);
z[1][3]=0;
System.out.print(z[1][3]);
z[1][4]=0;
System.out.print(z[1][4]);
z[1][5]=0;
System.out.println(z[1][5]);
z[2][0]=0;
System.out.print(z[2][0]);
z[2][1]=0;
System.out.print(z[2][1]);
z[2][2]=1;
System.out.print(z[2][2]);
z[2][3]=0;
System.out.print(z[2][3]);
z[2][4]=0;
System.out.print(z[2][4]);
z[2][5]=0;
System.out.println(z[2][5]);
z[3][0]=0;
System.out.print(z[3][0]);
z[3][1]=0;
System.out.print(z[3][1]);
z[3][2]=0;
System.out.print(z[1][2]);
z[3][3]=1;
System.out.print(z[3][3]);
z[3][4]=0;
System.out.print(z[3][4]);
z[3][5]=0;
System.out.println(z[3][5]);
z[4][0]=0;
System.out.print(z[4][0]);
z[4][1]=0;
System.out.print(z[4][1]);
z[4][2]=0;
System.out.print(z[4][2]);
z[4][3]=0;
System.out.print(z[4][3]);
z[4][4]=1;
System.out.print(z[4][4]);
z[4][5]=0;
System.out.println(z[4][5]);
z[5][0]=0;
System.out.print(z[5][0]);
z[5][1]=0;
System.out.print(z[5][1]);
z[5][2]=0;
System.out.print(z[5][2]);
z[5][3]=0;
System.out.print(z[5][3]);
z[5][4]=0;
System.out.print(z[5][4]);
z[5][5]=1;
System.out.println(z[5][5]);
}}