Form1.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace EfimovRoman
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. private void Form1_Load(object sender, EventArgs e)
  19. {
  20. }
  21. public static double sum(double a, double b)
  22. {
  23. return a + b;
  24. }
  25. public static double razn(double a, double b)
  26. {
  27. return a - b;
  28. }
  29. public static double umnog(double a, double b)
  30. {
  31. return a * b;
  32. }
  33. public static double del(double a, double b)
  34. {
  35. return a / b;
  36. }
  37. public static double step(double a, double b)
  38. {
  39. return Math.Pow(a, b);
  40. }
  41. public static double koren(double a, double b)
  42. {
  43. return Math.Pow(a, 1 / b);
  44. }
  45. private void button1_Click(object sender, EventArgs e)
  46. {
  47. textBox3.Text = Convert.ToString(sum(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  48. }
  49. private void button2_Click(object sender, EventArgs e)
  50. {
  51. textBox3.Text = Convert.ToString(razn(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  52. }
  53. private void button3_Click(object sender, EventArgs e)
  54. {
  55. textBox3.Text = Convert.ToString(umnog(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  56. }
  57. private void button4_Click(object sender, EventArgs e)
  58. {
  59. textBox3.Text = Convert.ToString(del(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  60. }
  61. private void button5_Click(object sender, EventArgs e)
  62. {
  63. textBox3.Text = Convert.ToString(step(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  64. }
  65. private void button6_Click(object sender, EventArgs e)
  66. {
  67. textBox3.Text = Convert.ToString(koren(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  68. }
  69. private void textBox1_TextChanged(object sender, EventArgs e)
  70. {
  71. }
  72. private void textBox2_TextChanged(object sender, EventArgs e)
  73. {
  74. }
  75. private void textBox3_TextChanged(object sender, EventArgs e)
  76. {
  77. }
  78. }
  79. }