#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

puts"九九の表"
gyou = 1
retsu = 1
gyou < 10 #縦に繰り返し
  retsu = 1
  printf("%4d | ", retsu)
  retsu2 = 1
  while retsu2 < 9 #横行の書き込み
    printf("%2d | ", (retsu2+=1)*gyou)
  end
  gyou += 1
  puts
  while gyou < 10
    retsu += 1
    printf("%4d | ", retsu)
    retsu2 = 1
    while retsu2 < 9
      printf("%2d | ", (retsu2+=1)*gyou)
    end
    puts
    gyou += 1
  end
