Pergunta de entrevista da empresa Oracle

print this pattern if input is 6 1 2 3 4 5 6 ... and so on ... if the input doesnt fit the pattern, give the remainder ....

Resposta da entrevista

Sigiloso

10 de fev. de 2013

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 numbermatrix { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { int n = int.Parse(textBox1.Text); int line=1,number=1; int identify; while (number = line || (identify == 1)) { textBox2.Text = textBox2.Text + number.ToString()+ " "; number++; count++; identify=1; } else { textBox3.Text = textBox3.Text + number.ToString()+" "; number++; count++; } } textBox2.Text = textBox2.Text + Environment.NewLine; line++; } } } }