Advertisement
cp-pum4

Untitled

Feb 20th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int aprobados=0;
  8.     int reprobados=0;
  9.     int contadorAlumnos=1;
  10.     int resultado;
  11.    
  12.     while ( contadorAlumnos <= 15 ) {
  13.    
  14.     cout << "Introduce resultado (1 = aprobado, 2 = reprobado) :";
  15.     cin >> resultado;
  16.    
  17.     if ( resultado==1)
  18.         aprobados = aprobados + 1;
  19.        
  20.     else
  21.         reprobados = reprobados + 1;
  22.        
  23.     contadorAlumnos = contadorAlumnos +1;
  24.    }
  25.    
  26.    cout << "Aprobados " << aprobados << endl;
  27.    cout << "Reprobados " << reprobados << endl;
  28.    
  29.    if ( aprobados > 10 )
  30.         cout << "Aumentar inscripciones " << endl;
  31.        
  32.        
  33.         return 0;
  34.        
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement