Вы находитесь на странице: 1из 5

using using using using using using using using using

System; System.IO; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms;

namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { textBox5.Text = textBox1.Text + textBox2.Text + textBox3.Text + textBox4.Text; } private void button2_Click(object sender, EventArgs e) { string out_path = @"C:\Users\giorgiana\Documents\Visual Studio 2010\Projects\output.txt"; FileStream outputfile = new FileStream(out_path, FileMode.Append, FileAccess.Write); StreamWriter out_stream = new StreamWriter(outputfile); textBox5.Text = textBox1.Text + textBox2.Text + textBox3.Text + textBox4.Text; out_stream.WriteLine(textBox1.Text + "\n"); out_stream.WriteLine(textBox2.Text + "\n"); out_stream.WriteLine(textBox3.Text + "\n"); out_stream.WriteLine(textBox4.Text + "\n"); out_stream.WriteLine(textBox5.Text + "\n"); out_stream.Close(); } } }

private void button2_Click(object sender, EventArgs e) { string out_path = @"C:\Users\giorgiana\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\output.txt"; FileStream outputfile = new FileStream(out_path, FileMode.Append, FileAccess.Write); StreamWriter out_stream = new StreamWriter(outputfile); textBox4.Text = textBox1.Text + textBox2.Text + textBox3.Text; out_stream.WriteLine(textBox4.Text + "\n"); out_stream.Close();

} private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox4.Text = textBox1.Text + textBox2.Text + textBox3.Text; Console.WriteLine(textBox4.Text); }

parola Laurentiu95.

string question = "hOW DOES mICROSOFT wORD DEAL WITH THE cAPS lOCK KEY?"; System.Text.StringBuilder sb = new System.Text.StringBuilder(question); for (int j = 0; j < sb.Length; j++) { if (System.Char.IsLower(sb[j]) == true) sb[j] = System.Char.ToUpper(sb[j]); else if (System.Char.IsUpper(sb[j]) == true) sb[j] = System.Char.ToLower(sb[j]); } // Store the new string. string corrected = sb.ToString(); System.Console.WriteLine(corrected); // Output: How does Microsoft Word deal with the Caps Lock key?

11octombrie
Crout function [L,U]=crout(A) n=size(A); for i=1:n L(i,1)=A(i,1); U(i,i)=1 end for j=2:n U(1,j)=A(1,j)/L(1,1) end for i=2:n for j=2:i L(i,j)=A(i,j)-L(i,1:j-1)*U(1:j-1,j); end for j=i+1:n U(i,j)=A(i,j)-L(i,1:i-1)*U(1:i-1,j)/L(i,i) end

end for j=2:n A(1,j)=A(1,j)/L(1,1); end for k=2:n for i=k:n sum=0.0 for j=1:k-1 sum=sum+L(i,j)*U(j,k) end A(i,k)=A(i,k)-sum end if(k==n) end for j=k+1:n sum1=0.0 for i=1:k-1 sum1=sum1+L(k,i)*U(k,j) end A(k,j)=(A(k,j)-sum)/L(k,k) end end

using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.IO;

namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) textBox1.Enabled = true; else textBox1.Enabled = false; } private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (checkBox2.Checked)

textBox2.Enabled = true; else textBox2.Enabled = false; } private void checkBox3_CheckedChanged(object sender, EventArgs e) { if (checkBox3.Checked) textBox3.Enabled = true; else textBox3.Enabled = false; } private void textBox3_TextChanged(object sender, EventArgs e) { char charAbs; bool ABS; int intAbs = Console.Read(); if (intAbs == 1) ABS = true; else ABS = false; if (ABS == true) charAbs = 'Y'; else charAbs = 'N'; } private void button1_Click(object sender, EventArgs e) { if (textBox3.Text.Equals('1')) textBox4.Text = "EN-" + textBox1.Text + " " + "NS-" + textBox2.Text + " " + "ABS-" + 'N'; else textBox4.Text = "EN-" + textBox1.Text + " " + "NS-" + textBox2.Text + " " + "ABS-" + 'Y'; } private void button2_Click(object sender, EventArgs e) { listBox1.Items.Add(textBox4.Text); } private void button3_Click(object sender, EventArgs e) { string outPath = @"D:\NitaVicentiu\output.txt"; FileStream outputFile = new FileStream(outPath, FileMode.Open, FileAccess.Write); StreamWriter outStream = new StreamWriter(outputFile); outStream.Write(textBox4.Text); outStream.Close();

} private void button4_Click(object sender, EventArgs e) { Form2 form2 = new Form2(); form2.Show(); }

} }