fork download
  1. #include <iostream>
  2. #include<string>
  3. #include<map>
  4. using namespace std;
  5.  
  6. int main() {
  7. map<char,int> cnt;
  8. string str;
  9. cin>>str;
  10.  
  11. for( char ch: str)
  12. cnt[ch]++;
  13. cout<<"Entered string :"<<str;
  14. cout<<"\nCOUNT STATS";
  15. cout<<"\nAlanine A :"<<cnt['A'];
  16. cout<<"\nArginine R :"<<cnt['R'];
  17. cout<<"\nAsparagine N :"<<cnt['N'];
  18. cout<<"\nAspartic acid D :"<<cnt['D'];
  19. cout<<"\nCysteine C :"<<cnt['C'];
  20. cout<<"\nGlutamine Q :"<<cnt['Q'];
  21. cout<<"\nGlutamic acid E :"<<cnt['E'];
  22. cout<<"\nGlycine G :"<<cnt['G'];
  23. cout<<"\nHistidine H :"<<cnt['H'];
  24. cout<<"\nIsoleucine I :"<<cnt['I'];
  25. cout<<"\nleucine L :"<<cnt['L'];
  26. cout<<"\nlysine K :"<<cnt['K'];
  27. cout<<"\nMethionine M :"<<cnt['M'];
  28. cout<<"\nPhenylalanine F :"<<cnt['F'];
  29. cout<<"\nProline P :"<<cnt['P'];
  30. cout<<"\nSerine S :"<<cnt['S'];
  31. cout<<"\nThreonine T :"<<cnt['T'];
  32. cout<<"\nTryptophan W :"<<cnt['W'];
  33. cout<<"\nTyrosine Y :"<<cnt['Y'];
  34. cout<<"\nValine V :" <<cnt['V'];
  35. cout<<"\nAsparagine/aspartic acid B :"<<cnt['B'];
  36. cout<<"\nGlutamine/glutamic acid Z :"<<cnt['Z'];
  37. return 0;
  38. }
Success #stdin #stdout 0s 4500KB
stdin
LVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKMIGGIGGFIKVRQYDQIPIEICGHKAAGTVLIGPTPVNIIGRNLLTQIGCTLNF
stdout
Entered string :LVTIKIGGQLKEALLDTGADDTVLEEMNLPGRWKPKMIGGIGGFIKVRQYDQIPIEICGHKAAGTVLIGPTPVNIIGRNLLTQIGCTLNF
COUNT STATS
Alanine       A :4
Arginine      R :3
Asparagine    N :4
Aspartic acid D :4
Cysteine	  C :2
Glutamine     Q :4
Glutamic acid E :4
Glycine       G :13
Histidine     H :1
Isoleucine    I :12
leucine       L :10
lysine        K :6
Methionine    M :2
Phenylalanine F :2
Proline       P :5
Serine        S :0
Threonine     T :7
Tryptophan    W :1
Tyrosine      Y :1
Valine        V :5
Asparagine/aspartic acid B :0
Glutamine/glutamic acid  Z :0