fork download
  1. #include <map>
  2. #include <string>
  3. #include <iostream>
  4.  
  5. void pn() { std::cout << "poniedzialek\n"; }
  6. void wt() { std::cout << "wtorek\n"; }
  7.  
  8. int main()
  9. {
  10. typedef void(*fDay)();
  11. std::map<std::string, fDay> days;
  12. days["pn"] = pn;
  13. days["wt"] = wt;
  14.  
  15. (days.find("wt")->second)();
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
wtorek