-
Lenguaje
Java usando Scanner
-
Descripción
Lea N números e indique si ese valor es mayor a 10.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class MayoresA10 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int i, n;
double un_numero;
System.out.print("Ingresa el valor de n: ");
n = in.nextInt();
in.nextLine();
for (i=1; i<=n; i++) {
System.out.print("PROCESO " + i);
System.out.print("Ingresa el valor de un numero: ");
un_numero = in.nextDouble();
in.nextLine();
if(un_numero>10)
System.out.println("El valor es mayor a 10.");
System.out.println();
}
}
}
public class MayoresA10 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int i, n;
double un_numero;
System.out.print("Ingresa el valor de n: ");
n = in.nextInt();
in.nextLine();
for (i=1; i<=n; i++) {
System.out.print("PROCESO " + i);
System.out.print("Ingresa el valor de un numero: ");
un_numero = in.nextDouble();
in.nextLine();
if(un_numero>10)
System.out.println("El valor es mayor a 10.");
System.out.println();
}
}
}