import javax.swing.*; // program uses class Scanner

public class BPIH4E7B
{
     // main method begins execution of Java application
     public static void main( String args[] )
     {            
        // factorial
        String s; 
        long factorial=1;
        int number=Integer.parseInt(JOptionPane.showInputDialog("Enter a number: ")); // read number
        for(int i=1;i <=number;i++)
        {
        factorial*=i;
        }
        s=""+number+"! = "+factorial;
        JOptionPane.showMessageDialog(null,s,"factorial calculation",JOptionPane.PLAIN_MESSAGE);
     } // end method main
} // end class BPIH4E1
