-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
32 lines (28 loc) · 819 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
using namespace std ;
int main () {
int materie ;
int i ;
int k ;
int Numerovoti ;
int Votimateria ;
int Numeromateria = 0;
float media ;
cout << "Di quante materie vuoi calcolare la media? \n";
scanf("%d", &materie);
cout << "Di quanti voti vuoi calcolare la media ?\n";
scanf ("%d" , &Numerovoti);
int voti [materie] [Numerovoti] ;
for (i = 0 ; i < materie ; i++){
media = 0 ;
Numeromateria ++ ;
for (k = 0 ; k < Numerovoti ; k++ ){
cout << "Digita il voto :\n";
scanf ("%d", &Votimateria );
media += Votimateria ;
}
media /= Numerovoti ;
cout << "La media dei voti della" << Numeromateria << "^ materia è : " << media << "\n" ;
}
return 0 ;
}