using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Asteriscos_IX
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int numero;
private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
numero = int.Parse(textBox2.Text);
}
private void button2_Click(object sender, EventArgs e)
{
for (int r = 1; r <= numero; r++)
{
for (int c = 1; c <= numero; c++)
{
if ((c == 1 && r == 1) || (c == 2 && r == 2) || (c == 3 && r == 3) || (c == 4 && r == 4) || (c == 5 && r == 5) ||
(c == 6 && r == 6) || (c == 7 && r == 7) || (c == 8 && r == 8) || (c == 9 && r == 9) || (c == 10 && r == 10))
{
textBox1.Text += "#";
}
else
{
textBox1.Text += "$";
}
}
textBox1.Text += "\r\n";
}
}
}
}
No hay comentarios:
Publicar un comentario
Nota: solo los miembros de este blog pueden publicar comentarios.