fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. struct Voter
  5. {
  6. Voter(std::string ID) : id(ID)
  7. {
  8. }
  9.  
  10. std::string ID()
  11. {
  12. return id;
  13. }
  14.  
  15. private:
  16. std::string id;
  17. };
  18.  
  19. int main()
  20. {
  21. Voter v ("19810102009");
  22. std::string Id;
  23. std::cin >> Id;
  24. if(v.ID() == Id)
  25. {
  26. std::cout << "CORRECT!" << std::endl;
  27. }
  28. else
  29. {
  30. std::cout << "Invalid username or password." << std::endl;
  31. }
  32. }
Success #stdin #stdout 0s 2988KB
stdin
1981010209
stdout
Invalid username or password.