hdu 2527

  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7. int n;
  8. cin>>n;
  9. while(n--)
  10. {
  11. map<char, int> count;
  12. map<char, int>::iterator iter;
  13. int m;
  14. string temp;
  15. cin>>m>>temp;
  16. for(int i=0; i<temp.length(); i++)
  17. {
  18. iter=count.find(temp[i]);
  19. if(iter==count.end() )
  20. {
  21. count[temp[i]]=1;
  22. }
  23. else
  24. {
  25. count[temp[i]]=iter->second+1;
  26. }
  27. }
  28. }
  29. return 0;
  30. }





附件列表

    原文地址:https://www.cnblogs.com/sober-reflection/p/5f455503a10c48ff4d2873de261e1c56.html