All pastes #240370 Raw Edit

WerK

public java v1 · immutable
·published 2006-11-05 18:57 UTC
rendered paste body
import java.util.*;public class cv5du4 {    static {Locale.setDefault(Locale.US);}    /*     * Pokro&#269;ilí: Vykreslete obdélník a v n&#283;m úhlop&#345;í&#269;ky.     */    public static void main(String[] args ) {        Scanner scan=new Scanner(System.in);        System.out.println(">>>  START "+Locale.getDefault()+"  # 1  \n");        System.out.println("Zadej sirku obdelnika");        int a = scan.nextInt();        System.out.println("Zadej vysku obdelnika");        int b = scan.nextInt();        double u1 = 1;        double u2 = a-2;         for (int i = 0;i<b;i++)        {            if ((i == 0)||(i == (b-1)))            {                for (int j = 0;j<a;j++)                    System.out.print("*");                System.out.println("");                continue;            }            else            {                for (int j = 0;j<a;j++)                {                    if ((j == 0)||(j == (a-1))||(j == Math.round(u1))||(j == Math.round(u2)))                        System.out.print("*");                    else                        System.out.print(" ");                }                System.out.println("");            }            u1 += (double) a/b;            u2 -= (double) a/b;        }        System.out.println(">>>  STOP");    }}