programación i - Universidad ORT Uruguay
programación i - Universidad ORT Uruguay
programación i - Universidad ORT Uruguay
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Programación I 145<br />
public class ClasePracticoDos {<br />
public static void main (String args[] ) {<br />
// ejercicio 1<br />
int i;<br />
int n;<br />
int dato;<br />
int suma;<br />
int cant2;<br />
int cant3;<br />
// ingreso cantidad<br />
Scanner input = new Scanner(System.in);<br />
input.useDelimiter(System.getProperty("line.separator"));<br />
System.out.println("Ingrese la cantidad");<br />
n = input.nextInt();<br />
suma = 0;<br />
cant2 = 0;<br />
cant3 = 0;<br />
for (i = 1; i 0) {<br />
System.out.println("La cantidad de datos es "+n);<br />
System.out.println("Hubo "+cant2 + "pares");<br />
System.out.println("Hubo "+cant3 + "multiplos de 3");<br />
System.out.println("Promedio "+(suma/n) );<br />
}<br />
else {<br />
System.out.println("Sin datos ");<br />
}<br />
// Ejercicio 3, práctico 1 (se asume n positivo)<br />
System.out.println("Ingrese el numero para mostrar las cifras ");<br />
n = input.nextInt();<br />
System.out.println(n % 10);<br />
n = n / 10;<br />
while (n > 0) {<br />
System.out.println(n % 10);<br />
n = n / 10;<br />
}<br />
// Ejercicio 6, práctico 1<br />
int he;<br />
int me;<br />
int hs;