SI204 Hankel Matrix Problem

#include <iostream>

using namespace std;

int main()
{
  // Read in the parameter n

  // Write Hankel matrix 1,...,2*n

  return 0;
}
#include <iostream>

using namespace std;

int main()
{
  // Read in the parameter n

  // Write Hankel matrix 1,...,2*n
  for(int row = 1; row <= n; row++)
  {
    // Write row entries row, ..., row + n
  }

  return 0;
}
#include <iostream>

using namespace std;

int main()
{
  // Read in the parameter n

  // Write Hankel matrix 1,...,2*n
  for(int row = 1; row <= n; row++)
  {
    // Write row entries row, ..., row + n
    for(int col = 1; col <= n; col++)
    {
      // Write entry (row,col) in two spaces
    }
  }

  return 0;
}
#include <iostream>

using namespace std;

int main()
{
  // Read in the parameter n

  // Write Hankel matrix 1,...,2*n
  for(int row = 1; row <= n; row++)
  {
    // Write row entries row, ..., row + n
    for(int col = 1; col <= n; col++)
    {
      // Write entry (row,col) in two spaces
      int val = row + (col - 1);
      if (val < 10)
	cout << ' ';
      cout << val << ' ';
    }
    cout << endl;
  }

  return 0;
}
#include <iostream>

using namespace std;

int main()
{
  // Read in the parameter n
  int n;
  cout << "Enter value n, where n < 50: ";
  cin >> n;

  // Write Hankel matrix 1,...,2*n
  for(int row = 1; row <= n; row++)
  {
    // Write row entries row, ..., row + n
    for(int col = 1; col <= n; col++)
    {
      // Write entry (row,col) in two spaces
      int val = row + (col - 1);
      if (val < 10)
	cout << ' ';
      cout << val << ' ';
    }
    cout << endl;
  }

  return 0;
}

Christopher W Brown
Last modified: Mon Sep 10 16:45:29 EDT 2001