Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement