Public
Authored by Mary Ryan

Exercice 2 - Structures de controle

#include <iostream>
#include <string>
using namespace std;

int main () {
string login = "Admin", mdp = "password", login2, mdp2;

cout << "Saisir votre nom d'utilisateur : " << endl;
cin >> login2;
cout << "Saisir votre mot de passe : " << endl;
cin >> mdp2;

if (mdp == mdp2 && login == login2) {
    cout << "Bienvenue" << endl;
}

else if (login != login2) {
    cout << "Nom d'utilisateur incorrect" << endl;
}

else if (mdp != mdp2) {
    cout << "Mot de passe incorrect" << endl;
}

return 0;

}
35 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment