holas estaba haciendo un programa en C++ y lko quise pasar a JAVA pero me sale un error en el while ..... a que se deve esto...
Código (java) [Seleccionar]
import javax.swing.*;
public class triangulo
{
public static void main(String[] args)
{
string n1=" ";
int n=" ";
n1=JOptionPane.showInputDialog("INGRSE PRIMERO PARAMETRO");
n=Integer.parseInt(n1);
while(n--)
{
string amp1=" ";
string freq1=" ";
int amp=0,freq=0,i=0;
amp1=JOptionPane.showInputDialog("INGRSE SEGUNDO PARAMETRO");
freq1=JOptionPane.showInputDialog("INGRSE TERCER PARAMETRO");
amp=Integer.parseInt(amp1);
freq=Integer.parseInt(freq1);
JOptionPane.showMessage(null," ");
for(i=0; i<freq; i++){
int j=0,k=0;
for(j=1; j<=amp; j++){
for(k=0;k<j;k++)
JOptionPane.showMessage(null,+j);
JOptionPane.showMessage(null," ");
}
for(j=amp-1; j>0; j--){
for(k=0;k<j;k++)
JOptionPane.showMessage(null,+j);
JOptionPane.showMessage(null," ");
}
if (i < freq-1 || n !=0)
JOptionPane.showMessage(null," ");
}
}
}
}