fork download
  1. #include <iostream>
  2. #include <map>
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. std::string name;
  8. std::string second_name;
  9. int mark_1;
  10. int mark_2;
  11. int mark_3;
  12.  
  13. std::map<std::string, int> m;
  14.  
  15. std::cin >> name >> second_name >> mark_1 >> mark_2 >> mark_3;
  16.  
  17. m[name + ' ' + second_name] = mark_1 + mark_2 + mark_3;
  18.  
  19. std::cout << m["vasyan pupkin"];
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3464KB
stdin
vasyan pupkin 2 2 1
stdout
5