Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
#include
#include
#include
using namespace std; int main() { string text = "I love learning C++"; stringstream ss(text); string word; int count = 0; while (ss >> word) { count++; } cout << "Number of words: " << count; return 0; }
Number of words: 4