fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char *word = new char[251];
  6. int count = 0;
  7. while(cin >> word) count++;
  8. cout << count;
  9. return 0;
  10. }
Success #stdin #stdout 0s 15232KB
stdin
Hello world!
stdout
2