Advertisement
urksiful

Club #CodeJaguar Basketbol Game

Nov 19th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. /**
  5.  *
  6.  * @author urksiful
  7.  */
  8. public class Main{
  9.  
  10.     public static void main(String[] args) {
  11.         Scanner x = new Scanner(System.in);
  12.  
  13.         int n = 1, puntos = 0, equipos = 0;
  14.  
  15.         /*EUP Que reciba las canastas que han hecho en un
  16.          torneo de basketbol, el programa recibira el numero
  17.          de canastas por equipo hasta que se ingrese un 0, y
  18.          debera de mostrar el promedio de canastas y el numero
  19.          de equipos que jugaron*/
  20.         n = x.nextInt();
  21.  
  22.         while (n != 0) {
  23.             puntos += n;
  24.             equipos++;
  25.             n = x.nextInt();
  26.         }
  27.  
  28.         System.out.println("Promedio: " + (puntos / equipos));
  29.         System.out.println("Equipos: " + equipos);
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement