2010年10月1日 星期五

2010/10/01

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        Form2 newform;
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
        }
        private void button3_Click(object sender, EventArgs e)
        {
            newform = new Form2();
            newform.Show();
        }
    }
}
------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int i, j;
            int sum = 0;
            int[,] arr1 = new int[10, 10];
            for (i = 1; i <= 9; i++)
            {
                for (j = 1; j <= 9; j++)
                {
                    sum = i * j;
                    arr1[i, j] = sum;
                   
                }
            }

            for (i = 1; i <= 9; i++)
            {
                for (j = 1; j <= 9; j++)
                {

                    listBox1.Items.Add("i=" + i + ",j=" + j + ",i*j=" + arr1[i, j]);
                }
            }
          
           
          


        }
    }
}



沒有留言:

張貼留言

Use google protocol buffers + QT +CMAKE

Protocol Buffers https://developers.google.com/protocol-buffers/ Serialize and ParseFrom https://www.jianshu....