fork(3) download
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. using namespace std;
  5. class MapClass {
  6. public:
  7. static map<string, map<string, double>> spreadMap;
  8. };
  9. //map<string, map<string, double>> MapClass::spreadMap = {
  10. // {"A", {{"B", 0}}},
  11. // {"C", {{"D", 1}}},
  12. // {"E", {{"F", 2}}}
  13. //};
  14. map<string, map<string, double>> MapClass::spreadMap
  15. { // opening brace for the map of map
  16. { // opening of a brace for a first element
  17. "A", // first key
  18. { // <<<<= opening brace for the first value wich is a map
  19. {"B", 0} // pair of key, value for the inner map
  20. } // <<<<= closing brace for the inner map
  21. }, // closing of the brace for the first element
  22. {"C", {{"D", 1}}}, // second element with second map
  23. {"E", {{"F", 2},{"G",3}}} // (the inner map could have itself several values...
  24. }; // closing brace for the map of map
  25.  
  26. int main() {
  27. // your code goes here
  28. return 0;
  29. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
Standard output is empty