Advertisement
Guest User

yup

a guest
Dec 16th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. String sNumbers = JOptionPane.showInputDialog("Enter in the amount of possible numbers: \n");
  2.         int iNumbers = Integer.parseInt(sNumbers);
  3.         String sBalls = JOptionPane.showInputDialog("Enter in the amount of balls taken: \n");
  4.         int iBalls = Integer.parseInt(sBalls);
  5.         int iFactorial = 1;
  6.         int iCount = 0;
  7.         int iTotal = iNumbers;
  8.  
  9.         for(iCount = (iNumbers - 1); iCount > (iNumbers - iBalls); iCount--){
  10.             iTotal *= iCount;
  11.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement