1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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 grishin_calculator
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(sum(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button2_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(umnog(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button3_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(step(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button4_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(razn(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button5_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(del(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button6_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(koren(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- public static double sum(double a, double b)
- {
- return a + b;
- }
- public static double razn(double a, double b)
- {
- return a - b;
- }
- public static double umnog(double a, double b)
- {
- return a * b;
- }
- public static double del(double a, double b)
- {
- return a / b;
- }
- public static double step(double a, double b)
- {
- return Math.Pow(a, b);
- }
- public static double koren(double a, double b)
- {
- return Math.Pow(a, 1 / b);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
-
- }
- }
|