Posted By

k9flow on 04/04/10


Tagged

check password to user if easy statement do account myg0t


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

oakdragon


Account / Password


 / Published in: C++
 

Well Here...

Newbs Only!

  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string username; // Created By k9flow
  7. string password;
  8. string user;
  9. string pass;
  10. pass = "myg0t"; // Declaring
  11. user = "myg0t"; // Declaring
  12. int code;
  13. code = rand();
  14. system("cls");
  15. cout << "Username: ";
  16. cin >> username;
  17. if (username == user) {
  18. system("cls");
  19. cout << "Password: ";
  20. cin >> password;
  21. if (password == pass) { // Checks the recorded string "password"
  22. system("cls");
  23. cout << "You Have Logged In!\n";
  24. cout << "\n";
  25. cout << "The Code Is " << code << " !\n"; // Displays Code!
  26. cout << "\n";
  27. system("PAUSE");
  28. return 0;
  29. }
  30. else { // If the string is wrong...
  31. system("cls");
  32. cout << "Wrong Password~!~!\n";
  33. system("PAUSE");
  34. main();
  35. }
  36. return 0;
  37. }
  38. }

Report this snippet  

You need to login to post a comment.