Language: C++

#include <bits/stdc++.h>
using namespace std;

int phrase[5] = {5,7,5,7,7};

int main() {

    while(1){

        int n;

        cin >> n;

        if(n==0) break;

        vector<string> w;

        for(int i=0; i<n; i++){
            string input;
            cin >> input;
            w.push_back(input);
        }

        int w_pos = 0;

        while(1){

            int w_itr = w_pos, nowp = 0, pcount = 0;

            while(1){
                if(w[w_itr].size() + pcount > phrase[nowp]){
                    nowp = -1;
                    break;
                }
                else if(w[w_itr].size() + pcount == phrase[nowp]){
                    nowp++;
                    if(nowp == 5){
                        break;
                    }
                    pcount = 0;
                }
                else{
                    pcount += w[w_itr].size();
                }
                w_itr++;
            }

            if(nowp == 5){
                break;
            }#include <bits/stdc++.h>
using namespace std;

int phrase[5] = {5,7,5,7,7};

int main() {

    while(1){

        int n;

        cin >> n;

        if(n==0) break;

        vector<string> w;

        for(int i=0; i<n; i++){
            string input;
            cin >> input;
            w.push_back(input);
        }

        int w_pos = 0;

        while(1){

            int w_itr = w_pos, nowp = 0, pcount = 0;

            while(1){
                if(w[w_itr].size() + pcount > phrase[nowp]){
                    nowp = -1;
                    break;
                }
                else if(w[w_itr].size() + pcount == phrase[nowp]){
                    nowp++;
                    if(nowp == 5){
                        break;
                    }
                    pcount = 0;
                }
                else{
                    pcount += w[w_itr].size();
                }
                w_itr++;
            }

            if(nowp == 5){
                break;
            }

            w_pos++;


        }

        cout << w_pos + 1 << endl;

    }

    return 0;
}

            w_pos++;


        }

        cout << w_pos + 1 << endl;

    }

    return 0;
}

Compiler output:
a.cc:50:14: error: stray '#' in program
   50 |             }#include <bits/stdc++.h>
      |              ^
a.cc: In function 'int main()':
a.cc:50:15: error: 'include' was not declared in this scope
   50 |             }#include <bits/stdc++.h>
      |               ^~~~~~~
a.cc:50:24: error: 'bits' was not declared in this scope
   50 |             }#include <bits/stdc++.h>
      |                        ^~~~
a.cc:50:29: error: 'stdc' was not declared in this scope; did you mean 'std'?
   50 |             }#include <bits/stdc++.h>
      |                             ^~~~
      |                             std
a.cc:51:1: error: expected primary-expression before 'using'
   51 | using namespace std;
      | ^~~~~
a.cc:55:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   55 | int main() {
      |         ^~
a.cc:55:9: note: remove parentheses to default-initialize a variable
   55 | int main() {
      |         ^~
      |         --
a.cc:55:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:55:12: error: a function-definition is not allowed here before '{' token
   55 | int main() {
      |            ^