Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this zadacha from e-olimp
- //more on e-olimp.com
- #include<iostream>
- #include<string>
- using namespace std;
- int main()
- {
- string stroka;
- getline(cin,stroka);
- int ras = stroka.length();
- int sch=0;
- for (int i = 0; i < ras; i++)
- {
- if (stroka[i] == ' ') { sch++; }
- }
- cout<<sch+1<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement