fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <iostream>
  9. #include<stdio.h>
  10. #include<map>
  11. #include<unordered_map>
  12. #include<map>
  13. using namespace std;
  14.  
  15. int main(){
  16.  
  17. map<string,int> m ;
  18.  
  19. m["sush"] = 5;
  20. m["a"] = 3;
  21. m["k"] = 4 ;
  22. m["tt"] = 6;
  23. m["ll"] = 25;
  24. cout << m.at("sush") << endl;
  25. cout << m["tt"] << endl;
  26. cout << m.size() << endl ;
  27. cout << m["ll"] <<endl;
  28. cout << m.size() << endl ;
  29.  
  30. }
  31.  
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
5
6
5
25
5