Thứ Ba, 3 tháng 5, 2022

BLIMP C++

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

string s;
int n;

void solve()
{
    cin >> n;
    getline(cin,s);
    int d=0;
    for(int i=1;i<=n;i++)
    {
        getline(cin,s);
        if(s.find("FBI")!=-1)
        {
            cout << i << " ";
            d++;
        }
    }
    if(d==0) cout << "GO";
}

int main()
{
    freopen("blimp.inp","r",stdin);
    freopen("blimp.out","w",stdout);
    solve();
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.