Está en la página 1de 1

TP N6

1)
import java.util.Scanner;

public class Ejercicio1 {


static Scanner teclado = new Scanner(System.in);
public static void main(String[] ar) {

int base, altura, sup, cant, c, n;


cant = 0;

System.out.print("Cuantos triangulos quiere ingresar");


n = teclado.nextInt();
for (c = 1; c <= n; c++) {
System.out.print("Ponga el valor de la base");
base = teclado.nextInt();
System.out.print("Ponga la altura:");
altura = teclado.nextInt();
sup = base * altura / 2;
System.out.print("La superficie es:");
System.out.println(sup);
if (sup > 12) {
cant = cant + 1;
}
}
System.out.print("La cantidad de triángulos con superficie superior a 12
son:");
System.out.print(cant);
}
}

2)

También podría gustarte