USACO JAN07LEVEL1 Problem 'mult' Analysis

by Rob Kolstad

The multiplication table problem has everything to do with:

Otherwise, it's fairly straightforward. Here ismy solution:
#include <stdio.h>
main() {
    FILE *fin = fopen ("mult.in", "r");
    FILE *fout = fopen ("mult.out", "w");
    int n, i, j;
    fscanf (fin, "%d", &n);
    fprintf (fout, " *");
    for (i = 1; i <= n; i++) fprintf (fout, "%4d", i);
    fprintf (fout, "\n");
    for (i = 1; i <= n; i++) {
	fprintf (fout, "%2d", i);
	for (j = 1; j <= n; j++) fprintf (fout, "%4d", i*j);
	fprintf (fout, "\n");
    }
    exit (0);
}