Notas
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem type
Allowed languages
C#, Go, Java, Python
Crea la classe Alumne
.
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
// escriu el codi aqui
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Alumno alumno = new Alumno();
int numeroNotas = scanner.nextInt();
alumno.notas = new float[numeroNotas];
for(int i=0; i<numeroNotas; i++){
alumno.notas[i] = scanner.nextFloat();
}
float suma = 0;
for(int i=0; i<numeroNotas; i++){
suma += alumno.notas[i];
}
System.out.println("Nota media: " + suma/numeroNotas);
}
}
Input Format
-
Constraints
-
Output Format
-
Test Case 1
Input
5
9 5.6 7 7.5 6.4
Output
Nota media: 7.1
Test Case 2
Input
3
10 5 0
Output
Nota media: 5.0
CC BY-NC-SA 4.0