#include "header.h" // File scope variables automatically initialized to bit string 000000 int Counts[256][256]; // Array of counts for dipthongs unsigned char uc[NMax+1]; // Array of Characters NMax #defined in header struct vec { int m; int n; int val;}; // Define a structure int order_q(const void * p1, const void * p2){ // fuction for qsort() int i1, i2; struct vec *pi1, *pi2; //Casting generic pointers to int * pi1 = (struct vec * ) p1; pi2 = (struct vec * ) p2; i1 = (*pi1).val; i2 = (*pi2).val; return (i2 - i1); } int main(){ clock_t start, stop; // clock() version char Format[20]; // Format String for scanf initialized imediately below unsigned char cOld, cNew; int i, j, n; // Initialize Format String for scanf sprintf(Format, "%%%dc", NMax); //printf("%s\n", Format); // Uncomment for check of format //Start Timer start = clock(); // clock() version // Get input and count // scanf returns 1 untill it returns -1 when it hits EOF while(scanf(Format, uc)>0){ n = strlen(uc); cOld=uc[0]; //Initialization for dipthong for(i=1;i=128 ) { if ( matrix[i][2]>=32 && matrix[i][2]<128) printf ("(%d,%d) ,%c %d\n", matrix[i][1], matrix[i][2], matrix[i][2], matrix[i][3]); else printf ("(%d,%d) , %d\n", matrix[i][1], matrix[i][2], matrix[i][3]); } else { if ( matrix[i][2]>=32 && matrix[i][2]<128) printf ("(%d,%d) %c,%c %d\n", matrix[i][1], matrix[i][2], matrix[i][1], matrix[i][2], matrix[i][3]); else printf ("(%d,%d) %c, %d\n", matrix[i][1], matrix[i][2], matrix[i][1], matrix[i][3]); } } //Printing timing printf("\nElapsed time = %g Seconds\n", (stop-start)/((double) CLOCKS_PER_SEC)); // clock() version return 0; }