#include <iostream>
using namespace std;
int main() {
int secciones;
cout << "Secciones: "; cin >> secciones;
double sumaGeneral = 0;
int totalEstudiantesGeneral = 0;
for(int i = 1; i <= secciones; i++) {
int nEstudiantes;
cout << "Cantidad de estudiantes en la Seccion " << i << ": ";
cin >> nEstudiantes;
double sumaSeccion = 0;
int aprobados = 0, reprobados = 0;
cout << "Ingrese las notas:\n";
for(int j = 0; j < nEstudiantes; j++) {
double nota;
cin >> nota;
sumaSeccion += nota;
sumaGeneral += nota;
totalEstudiantesGeneral++;
if(nota >= 61) aprobados++;
else reprobados++;
}
double promedioSeccion = (nEstudiantes > 0) ? (sumaSeccion / nEstudiantes) : 0;
cout << "Promedio: " << promedioSeccion << "; Aprobados: " << aprobados << "; Reprobados: " << reprobados << "\n";
}
double promedioGeneral = (totalEstudiantesGeneral > 0) ? (sumaGeneral / totalEstudiantesGeneral) : 0;
cout << "Promedio general: " << promedioGeneral << "\n";
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: