public class MediaNotas {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Digite a primeira nota : ");
double nota1 = scanner.nextDouble();
System.out.println("Digite a segunda nota : ");
double nota2 = scanner.nextDouble();
System.out.println("Digite a terceira nota ");
double nota3 = scanner.nextDouble();
double[] notas = {nota1,nota2,nota3};
double somaNotas = 0;
for(double n : notas){
somaNotas+=n;
}
double media = somaNotas/notas.length;
System.out.println("A média das notas é: " + media);
}
}