Bangeev

Untitled

Dec 11th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. $n = intval(readline());
  4. $counter = 0;
  5.  
  6. for($i = 0;$i <= $n;$n++){
  7.    
  8.     for($j = 0;$j <= $n;$j++){
  9.    
  10.         for($k = 0; $k <= $n; $k++){
  11.        
  12.             for($l = 0;$l <= $n; $l++){
  13.        
  14.                 for($m = 0;$m <= $n; $m++){
  15.        
  16.                     $combinations = $i + $j + $k + $l + $m;
  17.                     if($combinations === $n){
  18.                         $counter++;
  19.                        
  20.                     }
  21.                 }
  22.             }
  23.         }
  24.     }
  25.    
  26. }
  27. echo $counter;
Advertisement
Add Comment
Please, Sign In to add comment