import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
int[] valores = new int[5];
int soma = 0;
for (int i = 0 ; i <= 4 ; i++){
System.out.println("Entre com o " + (i+1) + "º valor:");
valores[i] = teclado.nextInt();
soma = soma + valores[i];
}
System.out.printf("A soma de todos os valores eh: %2.f%n", soma);
System.out.println("Os valores impares: ");
for(int i = 0; i <= 4; i++) {
if(valores[i] % 2 != 0) {
System.out.println(valores[i]);
}
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: