Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication1;
- import java.util.*;
- public class JavaApplication1 {
- public static void main(String[] args) {
- Scanner Wejscie = new Scanner(System.in);
- boolean stan=true;
- while(stan){
- int ilosc=0;
- while(ilosc<1 || ilosc>4){
- System.out.println("Podaj ilosc slupkow: ");
- ilosc=Wejscie.nextInt();
- }
- int[] Tablica = new int[ilosc];
- for(int i=0; i<Tablica.length; ++i){
- System.out.println("Podaj dlugosc slupka "+(i+1));
- Tablica[i]=Wejscie.nextInt();
- }
- for(int i: Tablica){
- for(int z=0; z<3; ++z){
- System.out.print("| ");
- for(int j=0; j<i; ++j)
- System.out.print("#");
- System.out.print("\n");
- }
- System.out.print("\n");
- }
- System.out.println("Kolejna tura (t/n)?");
- String whatEver = Wejscie.next();
- char literka = whatEver.charAt(0);
- if(literka=='n')
- stan=false;
- }
- }
- }
Add Comment
Please, Sign In to add comment