Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- //Pre: Llegeix una frase
- //Post: Ens diu el nombre de "hola" que hi han
- int main() {
- string h;
- int count = 0;
- while (cin >> h) {
- if (h == "hola") ++count;
- }
- cout << count << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement