#include "..\CookHeader.h"

int main() {
	string poet = "One little, Two little, Three little Indians \n";
	poet += "Four little, Five little, Six little Indians \n";
	poet += "Seven little, Eight little, Nine little Indians \n";
	poet += "Ten little Indian boys ";
		
	Array <char> charAry;
	Array <int>  countAry;

	for (int i = 0; i < len(poet); i++) {
		char ch = poet[i];
		if (('a' <= ch and ch <= 'z') || ('A' <= ch and ch <= 'Z')) {
			if (isInArray(charAry, ch)) {
				int index = find(charAry.begin(), charAry.end(), ch) - charAry.begin();
				countAry[index] ++;
			}
			else {
				charAry.push_back(ch);
				countAry.push_back(1);
			}
		}
	}
	println("원문");
	println(poet);
	println("--------------------");
	println("문자 빈도수 (10회 이상)");
	println("--------------------");
	for (int i = 0; i < len(charAry); i++) {
		if (countAry[i] >= 10) {
			print(charAry[i]);
			println("---->" + to_string(countAry[i]));
		}
	}
}