fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. getline(cin, s);
  8.  
  9. int hoa = 0, thuong = 0, so = 0;
  10.  
  11. for (int i = 0; i < s.length(); i++) {
  12. if (s[i] >= 'A' && s[i] <= 'Z') hoa++;
  13. else if (s[i] >= 'a' && s[i] <= 'z') thuong++;
  14. else if (s[i] >= '0' && s[i] <= '9') so++;
  15. }
  16.  
  17. cout << hoa << " " << thuong << " " << so << endl;
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5312KB
stdin
Ngay02tHAng09naM1945@
stdout
4 8 8