using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace UlamekDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Ulamek[] tablica = new Ulamek[10];
            for (int i = 0; i < tablica.Length; i++)
                tablica[i] = new Ulamek(1, i+1);

            string s = "Przed sortowaniem:\n";
            foreach (Ulamek u in tablica)
                s += u.ToString() + "=" + u.ToDouble().ToString() + "\n";
            MessageBox.Show(s);
            
            Array.Sort(tablica);

            s = "Po sortowaniu:\n";
            foreach (Ulamek u in tablica)
                s += u.ToString() + "=" + u.ToDouble().ToString() + "\n";
            MessageBox.Show(s);
        }
    }
}