fork(2) download
  1. #include <iostream>
  2. #include <map>
  3. #include <array>
  4. #include <string>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9. map <string, array<double,3>> Grade = {
  10. {"Bobby Jay", {{67.8, 44.5, 20.8}} },
  11. {"Bobby Tables", {{999.0, -1.2, 3.14}} }
  12. };
  13.  
  14. for(auto& p: Grade) {
  15. std::cout << "'" << p.first << "' => {";
  16. bool first=true;
  17. for(double d: p.second) {
  18. std::cout << (first?"":",") << d;
  19. first = false;
  20. }
  21. std::cout << "}\n";
  22. }
  23. }
  24.  
Success #stdin #stdout 0s 2988KB
stdin
Standard input is empty
stdout
'Bobby Jay' => {67.8,44.5,20.8}
'Bobby Tables' => {999,-1.2,3.14}