我想将学生的电话号码(字符串)映射到相应的标记和排名。格式如下:
myMap["9876543210"] = {"Marks" => 90, "Rank" => 3}
如何在C ++中完成?
答案 0 :(得分:2)
#include <map>
struct StudentData {
int marks;
int rank;
};
typedef std::map<std::string, StudentData> studentDataRepository;