Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/03/2014, 00:53
Avatar de vangodp
vangodp
 
Fecha de Ingreso: octubre-2013
Mensajes: 934
Antigüedad: 10 años, 7 meses
Puntos: 38
Respuesta: Usar "cin" dentro de un "if"?

Código C++:
Ver original
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main (){
  6.    
  7.     cout << "introduzca la bagaza";
  8.  
  9.    
  10.     if( cin.get() == '1' && cin.get() =='2')
  11.         cout << "correcto!";
  12.      else
  13.         cout << "No!";
  14.    
  15.    
  16.     cin.ignore();
  17.     return 0;
  18. }

=D