#include <stdio.h>
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h> /* for sleep */
#endif

#define NUMSTATES 12
#define searchtime 10

char *thestates[]={"Maine","New Hampshire","Vermont",
         "Massachusetts", "Rhode Island", "Connecticut",
         "New York", "New Jersey", "Pennsylvania", "Ohio",
         "Maryland", "Indiana"}; 
char *thecapitals[]={"Augusta","Concord","Montpelier",
         "Boston", "Providence", "Hartford", "Albany",
         "Trenton", "Harrisburg", "Columbus",
          "Annapolis", "Indianapolis"};

char *GetCapital(char *state)
{
    int i;
    char *result = NULL;
    printf("Searching for %s\n",state);
#ifdef WIN32
    Sleep(10000);
#else
    sleep(searchtime);
#endif

    for (i=0;i<NUMSTATES;i++) {
        if (strcmp(state,thestates[i])==0) {
             result = thecapitals[i];
             break;
        }
    }
    printf("Searching for %s complete\n",state);
    return result;
}
