#include #include #define MAX 1024 int main(int argc, char *argv[]) { int word_location[MAX] = {0}; for (int i = 1; i < argc; i++) { for (int j = 1; j < argc; j++) { if (strcmp(argv[i], argv[j]) == 0) { word_location[i]++; } } } int max = 0; int index = 0; for (int i = 0; i < argc; i++) { if (word_location[i] > max) { max = word_location[i]; index = i; } } printf("most common term is %s and it occurs %d times\n", argv[index], max); return 0; }