Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  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.Windows.Forms;
  9.  
  10. namespace лаба3на_отгруз
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. public double Skrug(double r1)
  20. {
  21. double p = 3.1416;
  22. return p * Math.Pow(r1, 2.0);
  23.  
  24. }
  25.  
  26. private void button1_Click(object sender, EventArgs e)
  27. {
  28. double r1, r2, S;
  29. r1 = Convert.ToDouble(textBox1.Text);
  30. r2 = Convert.ToDouble(textBox2.Text);
  31. S = Skrug(r2) - Skrug(r1);
  32. textBox3.Text = Convert.ToString(S);
  33. }
  34.  
  35. private void button2_Click(object sender, EventArgs e)
  36. {
  37. Close();
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement