All pastes #189422 Raw Edit

Something

public text v1 · immutable
·published 2006-10-03 02:05 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char **argv)
{
  int i, j;
  int w, h;
  if (argc != 3)
  {
    printf("Supply two integers.\n");
    return 1;
  }
  w = atoi(argv[1]);
  h = atoi(argv[2]);

  for (i = 0; i < h; i++)
  {
    for (j = 0; j < w; j++)
    {
      int ind, ni, nj;

      ni = ?;
      nj = ?;

      ind = ni * w + nj;
      printf("% 3d", ind);
    }
    printf("\n");
  }

  return 0;
}