using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static int calc(int a,int b) { int test; test = a + b; return test; } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { int function; function = calc(int.Parse(textBox1.Text), int.Parse(textBox1.Text)); textBox3.Text = function.ToString(); } private void button2_Click(object sender, EventArgs e) { textBox3.ResetText(); } } }
|
הבעיה היא שזה יודע לחבר רק 2 מספרים זוגיים ו2 מספרים אי זוגיים אם אני נותן לו אחד זוגי ואחד אי זוגי הוא נותן תוצאה שגויה:(
בטח יענו לי עוד חודש אז שיהיה