#include <iostream>
#include <stdio.h>
#include <string.h>
 
int main()
{
    char text[1000];
    char *word[1000] = { NULL, }; // 단어
    int count[1000] = { 0, }; // 출현 횟수
    int n = 0; // 단어 수
    char *w; // 읽은 단어
    int i;
 printf("문장을 입력하세요.");
 scanf("%[^
		]",text);
    w = strtok(text, " 	
		"); // 단어 읽기
    while (w) {
        // 등록 여부
        for (i = 0; i < n; i++) {
            if (strcmp(word, w) == 0) 
			return -1; // 등록되어 있음.
        }
        if (i < n) { // 등록되어 있음.
            count++; // 카운트 증가
        } else { // 새로운 단어
            word[n] = w; // 등록
            count[n] = 1;
            n++;
        }
 
        w = strtok(NULL, " 	
		"); // 다음 단어
    }
 
    for (i = 0; i < n; i++) {
        printf("%s: %d
		", word, count);
    }
return 0;
}
 for (i = 0; i < n; i++) {
            if (strcmp(word, w) == 0) 
			return -1; // 등록되어 있음.
        }
        if (i < n) { // 등록되어 있음.
            count++; // 카운트 증가
        } else { // 새로운 단어
            word[n] = w; // 등록
            count[n] = 1;
            n++;
        }
is_same_word(string arr[], string x, int y)함수를 구현시켜야 하는디 전 이게 string 쪽에 기본 있는 함순지 모르고 다 만들어 놓고 함수만 바꿔치기 하려고 했는데 멘붕이 왔습니다 ㅜㅜ 이걸 어찌 해결해야 할까요?
 
어디부터 손대야 할 지 좀 알려주실 수 있으신가요?