Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SerieMyoryMenorque {
- Scanner teclado = new Scanner(System.in);
- int n;
- public void entradatos() {
- System.out.print("Por favor ingrese n: ");
- n = teclado.nextInt();
- }
- public void proceso() {
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <=n; j++) {
- if(i % 2 ==0) {
- System.out.print(" >");
- }else {
- System.out.print("< ");
- }
- }
- System.out.println("");
- }
- }
- public static void main(String[] args) {
- SerieMyoryMenorque fc = new SerieMyoryMenorque();
- fc.entradatos();
- fc.proceso();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment