fork download
  1. #include <iostream>
  2. using namespace std;
  3. /*
  4. int pary(string s){
  5. int d=s.size(), ile=0;
  6. for (int i=1; i<d; ++i){
  7. if (s[i]==s[i-1]) ile++;
  8. }
  9. return ile;
  10. }
  11. int main() {
  12. string t;
  13. cin >> t;
  14. cout << pary(t);
  15. return 0;
  16. }
  17.  
  18. //Zadanie 2
  19. string ta(string s){
  20. int d=s.size();
  21. for (int i=0; i<d; ++i){
  22. if (s[i]=='C' or s[i]=='G' or s[i]=='T') s[i]='*';
  23. }
  24. return s;
  25. }
  26. int main() {
  27. string t;
  28. cin >> t;
  29. cout << ta(t);
  30. return 0;
  31. }
  32.  
  33. //Zadanie 3
  34. int hamming(string s, string t){
  35.  int d=s.size(), ile=0;
  36.  for (int i=0; i<d; ++i){
  37.   if (s[i]!=t[i]) ile++;
  38.  }
  39.  return ile;
  40. }
  41. int main() {
  42.  string t, s;
  43.  cin >> t >> s;
  44.  cout << hamming(s,t);
  45.  return 0;
  46. }
  47.  
  48. //Zadanie 4
  49. int main(){
  50. string s;
  51. cin>>s;
  52. int d=s.size();
  53. for(int i; i<d; i+=2)
  54. cout<<s[i]<<"";
  55. return 0;
  56. }
  57.  
  58. //Zadanie 5
  59. int main() {
  60.   string kolor, najdluzszy;
  61.   for (int i = 0; i < 10; i++) {
  62.   cin >> kolor;
  63.   if (kolor.size() >= najdluzszy.size())
  64.   najdluzszy = kolor;
  65.   }
  66. cout << najdluzszy;
  67.   return 0;
  68. }
  69.  
  70. //Zadanie 6
  71. int main() {
  72.  string s;
  73.  int d = 'a' - 'A';
  74.  getline(cin,s);
  75.  for (auto x: s){
  76.   if (x >= 'A')
  77.   if (x <= 'Z') cout << (char)(x+d);
  78.   else if (x >= 'a' and x <= 'z')
  79.   cout << (char)(x-d);
  80.  }
  81.  return 0;
  82. }
  83.  
  84. //Zadanie 7
  85. int main() {
  86.  string s;
  87.  cin >> s;
  88.  for (auto x: s){
  89.   if (x >= 'A' and x <= 'Z')
  90.   cout << x;
  91.  }
  92.  return 0;
  93. }
  94.  
  95. //Zadanie 8
  96. int main(){
  97. string wz, s;
  98. int ile=0;
  99. cin>>wz;
  100. do{
  101. cin>>s;
  102. if (s==wz) ile++;
  103. }while(s!="***");
  104. cout<<ile;
  105. return 0;
  106. }
  107. */
  108. //Zadanie 9
  109. int ile_sam(string s){
  110. int ile=0;
  111. for(auto x:s){
  112. if (x=='a' or x=='o' or x=='i' or x=='e' or x=='y' or x=='u') ile++;
  113. }
  114. return ile;
  115. }
  116. int main(){
  117. string s;
  118. cin>>s;
  119. cout<<ile_sam(s);
  120. return 0;
  121. }
Success #stdin #stdout 0.01s 5320KB
stdin
TTAT
***
stdout
Standard output is empty