Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 multiplication_table2
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int iTemp = 0;
- int jTemp = 0;
- string gap = "";
- string line = " "; //3 gaps
- for (int i = 0; i < numericUpDown1.Value; i++)
- {
- iTemp = i;
- iTemp++;
- line = line + iTemp + " ";
- iTemp = 0;
- }
- label2.Text = line + "\n";
- for (int i = 0; i < numericUpDown1.Value; i++)
- {
- iTemp = i;
- iTemp++;
- line = iTemp + " ";
- for (int j = 0; j < numericUpDown1.Value; j++)
- {
- jTemp = j;
- jTemp++;
- if (jTemp * iTemp > 9)
- {
- gap = "";
- } else
- {
- gap = " ";
- }
- line = line + jTemp * iTemp + " " + gap;
- }
- label2.Text = label2.Text + line + "\n";
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- label2.Text = "sjkdg;lkjsadjg\n sdfj\n";
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement