Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- #define USER "tito"
- #define pass "lol"
- using namespace std;
- int main(){
- string usuario ="",pss="";
- char caracter;
- int intentos = 3;
- for(int i =1; i<=intentos; i++){
- cout << "USUARIO: ";
- cin>>usuario;
- cout << "\nContrasena: ";
- caracter = getch();
- while(caracter != 13){
- pss.push_back(caracter);
- cout << "*";
- caracter = getch();
- }
- if(usuario == USER && pss == pass){
- cout << "\n\nBienvenido " << USER << " A la fiesta de la imaginacion"<< endl;
- intentos=0;
- }
- else{
- cout << "\n\n Usuario y/o Contrase?a no validos\ningrese los datos correctamente" << endl;
- }
- }
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement