Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string pass("pass");
  9. string str;
  10. cout << "print pass: ";
  11. cin >> str;
  12. cout << "\n";
  13.  
  14. bool check1 = false;
  15. bool check2 = false;
  16. bool check3 = false;
  17.  
  18. for (int i = 0; i <= pass.length(); i++)
  19. {
  20. if (pass[i] != str[i])
  21. {
  22. cout << "incorrect" << "\n";
  23. break;
  24. }
  25. if (i == pass.length())
  26. {
  27. cout << "correct" << "\n";
  28. }
  29. }
  30.  
  31. system("pause");
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement