Submission

Status:

TTTTTTTTTT

Subtask/Task Score:

0/100

Score: 0

User: KanemiyaKana

Problemset: เลขดวง

Language: cpp

Time: 1.097 second

Submitted On: 2026-10-03 16:51:37

#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main ()
{
    int count = 0;
    string input;
    string word;
    getline(cin, input);
    cin.ignore();
    if (input.length() > 10000)
    {
        cout << "input is longer than supported.";
        return 0;
    }
    cin >> word;
    if (word.length() > 20 || word.length() < 1)
    {
        cout << "input is longer than supported.";
        return 0;
    }
    int i = 0;
    while (i < input.length())
    {
        if (input.find(word, i) != string::npos)
        {
            count++;
            i = input.find(word);
        }
    }
    cout << count;
}