daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Combination {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int n = Integer.parseInt(scanner.nextLine());
  8.         int x1 = 0;
  9.         int x2 = 0;
  10.         int x3 = 0;
  11.         int x4 = 0;
  12.         int x5 = 0;
  13.         int count = 0;
  14.         for (int i = 1; i < x1; i++) {
  15.             for (int j = 1; j < x2; j++) {
  16.                 for (int k = 1; k < x3; k++) {
  17.                     for (int l = 1; l < x4; l++) {
  18.                         for (int m = 1; m < x5; m++) {
  19.                         }
  20.                         if (x1+x2+x3+x4+x5==n){
  21.                             count++;
  22.                             System.out.println(count);
  23.                         }
  24.                     }
  25.                 }
  26.             }
  27.         }
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top