online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// 3a.cpp #include <iostream> #include <cstdlib> // Libreria requerida para rand() y srand() #include <ctime> // Libreria requerida por time() y srand() using namespace std; typedef struct{ char nombre[10]; int notas[5]; } Alumno; void calificar(int m, int n, Alumno *alu){ int i, j; srand(time(NULL)); for(j=0; j<n-1; j++) for(i=0; i<m; i++){ alu[i].notas[j] = rand()%4+2; alu[i].notas[n-1] += alu[i].notas[j]; } } void reportar(int m, int n, Alumno *alu){ int minimo=20, medio=0, maximo=0; cout<<"Cuarta práctica de CC112\n"; cout<<"Nombre\tP1\tP2\tP3\tP4\tNota\n"; for(int i=0; i<m; i++){ cout<<alu[i].nombre<<"\t" <<alu[i].notas[0]<<"\t"<<alu[i].notas[1]<<"\t" <<alu[i].notas[2]<<"\t"<<alu[i].notas[3]<<"\t" <<alu[i].notas[4]<<endl; if(minimo>alu[i].notas[n-1]) minimo = alu[i].notas[n-1]; if(maximo<alu[i].notas[n-1]) maximo = alu[i].notas[n-1]; medio += alu[i].notas[n-1]; } cout<<"Nota mínima : "<<minimo<<endl; cout<<"Nota promedio: "<<(float)medio/m<<endl; cout<<"Nota máxima : "<<maximo<<endl; } int main(){ int m=3, n=5; Alumno alu [m] = {"Juan ", 0, 0, 0, 0, 0, "José ", 0, 0, 0, 0, 0, "Javier", 0, 0, 0, 0, 0 }; calificar(m, n, alu); reportar (m, n, alu); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue