#include <cstdio> #include <cstring> using namespace std; int main(){ char ch; int num = 0; while(EOF != scanf("%c", &ch)){ if(ch == ' '){ num = 0; } else{ num++; } } printf("%d", num-1); return 0; }
#include <cstdio> #include <cstring> using namespace std; int main(){ char ch; int num = 0; while(EOF != scanf("%c", &ch)){ if(ch == ' '){ num = 0; } else{ num++; } } printf("%d", num-1); return 0; }