c언어로는 구현 성공했습니다. 감사합니다 공고 선생님들. 근데 문제가 생겨서 이제 string으로 시도하고 있습니다.
#include <iostream>
#include <string>
using namespace std;
int is_same_word(string arr[], string x, int y);
int main()
{
    string sen; //입력할 문자열
    string words[1000];
    int counts[1000];
    static int count = 0;
    cout << "문장을 입력하세요. (문장의 끝은 'Enter'입니다.) \n";
    getline(cin, sen, '\n'); //문자열 입력받음
    int start_index = 0;
    while (true)
    {
        int find_index = sen.find(' ', start_index); //띄워쓰기를 기준으로 find_index에 저장
        if (find_index == -1)                        //띄워쓰기가 없는경우
        {
            string temp = sen.substr(start_index);
            if (is_same_word(words, sen, count) == -1) //배열에 없는경우
            {
                words[count] = temp;
                counts[count] = 1;
                break;
            }
            else //배열에 있는 경우
                        {
                for (int a = 0; a < count; a++)
                {
                    if (temp == words[a])
                        counts[a] = counts[a] + 1;
                    break;
                }
                        }
            break;
        }
        else //띄워쓰기가 있는 경우
        {
            int temp_len = find_index - start_index;         //단어의 길이
            string temp = sen.substr(start_index, temp_len); //단어 복사하여 temp에 저장
            if (is_same_word(words, sen, count) == -1) //배열에 없는경우
            {
                words[count] = temp;
                counts[count] = 1;
                count++;
                start_index = find_index + 1;
            }
            else //배열에 있는경우
            {
                for (int b = 0; b < count; b++)
                {
                    if (temp == words)
                        counts = counts + 1;
                    start_index = find_index + 1;
                }
            }
        }
    }
    for (int c = 0; c <= count; c++)
    {
        cout << words[c] << " : " << counts[c] << endl;
    }
    return 0;
}
int is_same_word(string arr[void], string x, int y) //검색하는 함수
{
    int word;
    for (int i = 0; i <= y; i++)
    {
        word = x.find(arr[y]);
    }
    return word;
} 
이게 제 함수인디 작동이 안되고 있습니다. 한 번만 봐주시고 어떤 부분이 잘못 됐는 지 좀 알려주실 수 있으신가욤?