fork download
  1. #define MAX 1000100
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. //printf("%d %d %d %d", 'A', 'Z', 'a', 'z');65 90 97 122
  8. char c;
  9. scanf("%1c", &c);
  10. int cnt = 0;
  11. if (c == ' '|| c == '\n') {
  12. printf("%d\n", cnt);
  13. return 0;
  14. }
  15. cnt++;
  16. for (int i = 1; i <= MAX; i++) {
  17. char c;
  18. scanf("%1c", &c);
  19. if (c == '\n') break;
  20. if (c == ' ') cnt++;
  21. }
  22. printf("%d\n", cnt);
  23. }
Success #stdin #stdout 0s 15232KB
stdin
 Mazatneunde Wae Teullyeoyo
stdout
0