fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int is_letter(char c) {
  5. if ((int) c >= 65 && (int) c <= 122) {
  6. return 1;
  7. } else {
  8. return 0;
  9. }
  10. }
  11.  
  12. int main () {
  13. char a, b, c;
  14.  
  15. cin >> a >> b >> c;
  16.  
  17. cout << is_letter (a) + is_letter (b) + is_letter(c);
  18. }
Success #stdin #stdout 0.01s 5324KB
stdin
q f A
stdout
3