Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ejercicio4;
- import java.util.*;
- public class Ejercicio4 {
- public static void main(String[] args) {
- Scanner sc= new Scanner(System.in);
- int tam, aux;
- int [] array;
- aux=0;
- System.out.println("Introduce tamaño de tu array: ");
- tam=sc.nextInt();
- array =new int [tam];
- for (int i = 0; i < tam; i++) {
- System.out.println("Introduce dato en posicion "+i+" para el array: ");
- array[i]=sc.nextInt();
- }
- for (int i = 0; i < tam; i++) {
- while(aux!=array[i]){
- aux++;
- }
- System.out.println(" ");
- while(aux!=0){
- System.out.print("* ");
- aux--;
- }
- }
- }
Add Comment
Please, Sign In to add comment