Test - import java.io i import java.util p public class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import java.util.*; i public class Test{ p public static Scanner teclado = new Scanner(System.in); p public static void met1(int n){ for(int i=1;i<=n;i++){ for(int u=1;u<=n;u++){ if(u==i) System.out.print(u); else System.out.print(0);} System.out.println();}} S public static void met2(int n){ for(int i=1;i<=n;i++){ for(int u=1;u<=n;u++){ if(u<=1) System.out.print(1); else if(u==n) System.out.print(u); else System.out.print(0);} System.out.println();}} S public static void met3(int n){ for(int i=1;i<=n;i++){ for(int u=1;u<=n;u++){ if(i<=1) System.out.print(1); else if(i==n) System.out.print(i); else System.out.print(0);} System.out.println();}} S public static void met4(int n){ for(int i=1;i<=n;i++){ for(int u=1;u<=n;u++){ if(u%2==0) System.out.print(0); else System.out.print(1);} System.out.println();}} S public static void met5(int n){ for(int i=1;i<=n;i++){ for(int u=1;u<=n;u++){ if(u%2==0) System.out.print(0); else if(u<=n) System.out.print(i);} System.out.println();}} S
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 4

Test - import java.io i import java.util p public class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online