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