#include <stdio.h>
#include "week4.c"
int main (int argc, char ** argv) {
if (argc < 2) {
printf("No size specified. Usage: %s <size>\n", *argv);
return 1;
}
unsigned short size;
if (!sscanf(argv[1], "%hu", &size)) {
printf("Invalid size specified.\n");
return 1;
}
unsigned short current;
unsigned short * result;
for (current = 5; current <= size; current ++) {
result = tour(current);
free(result); // not gonna use it, just see if there is one!
printf("% 4hu: %s\n", current, result ? "yes" : "no");
}
return 0;
}
Comments