All pastes #951325 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-21 07:41 UTC
rendered paste body
/*
 * Main.java
 *
 * Created on 21 Μάρτιος 2008, 8:44 πμ
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author students
 */

public class TextShape {
    
    public static void main(String [] args) {
        //To 1o orisma einai to plithos grammwn
        int rows=Integer.parseInt(args[0]);
        //to 20 orisma einai to plithos twn stilwn
        int cols=Integer.parseInt(args[1]);
        //To 3o orisma einai o xarakthras sxediasis
        String symbol=args[2];
        draw(rows,cols,symbol);
        
    }
    
    public static void draw(int x,int y, String a) {
        for(int i=1; i<=x; i++) {
            for(int j=1; j<=y-i; j++)
                System.out.print(" ");
            for(int k=1; k<=i; k++)
                System.out.print(a);
        }
        system.out.println();
    }
}