Está en la página 1de 2

import java.util.

*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".


class Main {
public static void main(String[] args) {
int numero = 1;
int numAst = 1;
do {
numAst=1;
do{
System.out.print(" * ");
numAst++;
}while(numAst<=numero);
numero++;
System.out.println();
}while(numero<=20);

}
}

**********************************************
@startuml

start
:numero=0;
:veces=1;
:numAst=1;

repeat
:calcular numero aleatorio;
:numAst=1;
:imprimir numer);
repeat
:imprimir asterisco;
:numAst++;
repeat while(numAst<=numero)
:salto de linea;
:veces++;
repeat while(veces<=10)

stop

@enduml

************************************************
@startuml

start
:i=0;
:prod=1;
:i=2;
while (i<=50)
:prod = prod*i;
:i= i+2;
:imprimir el producto parcial;
endwhile
:imprimir el total del producto;

stop

@enduml
*************************************************
@startuml

start
:i=1;
:j=1;
:fact=1;
:n=0;

while(i<=20)
:n=i;
while (j<=n)
:fact = fact*j;
:j= j+1;
endwhile
:i=i+1;
:imprimir el factorial de n;
endwhile
stop

@enduml
****************************************************

También podría gustarte