Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- int[] data = {
- factorial(10)/10,
- factorial(9)/10,
- factorial(8)/10
- // ...
- };
- JOptionPane.showConfirmDialog(null, data[q]);
- }
- public static int factorial(int n) {
- int ret = 1;
- for (int i = 1; i <= n; i++) {
- ret *= i;
- }
- return ret;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement