N pruduct
package aaaaa;
import javax.swing.JOptionPane;
public class aaa{
public static void main(String[] args) {
int i;
int ans=1;
int c;
while(1>=0)
{String number=JOptionPane.showInputDialog(" Enter a number");
c= Integer.parseInt(number);
ans=c*ans;
if (ans>=0)
{System.out.println("pruduct is "+ans);
}
else System.out.println("Finished");
}
}
}
import javax.swing.JOptionPane;
public class aaa{
public static void main(String[] args) {
int i;
int ans=1;
int c;
while(1>=0)
{String number=JOptionPane.showInputDialog(" Enter a number");
c= Integer.parseInt(number);
ans=c*ans;
if (ans>=0)
{System.out.println("pruduct is "+ans);
}
else System.out.println("Finished");
}
}
}
0 Comments:
張貼留言
<< Home