You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
533 B

  1. #include "flag.hpp"
  2. #include <fstream>
  3. #include <iostream>
  4. std::string Flag::flag = "";
  5. bool Flag::Load()
  6. {
  7. std::ifstream file("flag.txt");
  8. if (file.good())
  9. {
  10. file >> flag;
  11. return true;
  12. }
  13. else
  14. {
  15. return false;
  16. }
  17. }
  18. void Flag::Print()
  19. {
  20. if (Load())
  21. {
  22. std::cout << flag << std::endl;
  23. }
  24. else
  25. {
  26. std::cout << "Something went wrong on the server\n"
  27. << "Please contact the administrator...\n"
  28. << std::endl;
  29. }
  30. }