fork download
  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.  
  11. namespace App3
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. public static double Factorial(double n)
  21. {
  22. if (n == 0) return 1;
  23. else return n * Factorial(n - 1);
  24. }
  25.  
  26. public static double Equation(double x)
  27. {
  28. double Sx = 0;
  29. for (double n = 0; n <= 14; n++)
  30. {
  31. Sx += ((2 * n + 1) / Factorial(n)) * Math.Pow(x, 2 * n);
  32. }
  33. return Sx;
  34. }
  35. // Var 5
  36. private void Start_Click(object sender, EventArgs e)
  37. {
  38. res.Clear();
  39. double x1 = Convert.ToDouble(Boxx1.Text);
  40. double x2 = Convert.ToDouble(Boxx2.Text);
  41. double N = Convert.ToDouble(BoxN.Text);
  42. double h = (x2 - x1) / N;
  43. Boxh.Text = Convert.ToString(h);
  44. double Sx;
  45. double Yx;
  46. for (double x = x1; x <= x2; x += h)
  47. {
  48. Sx = Equation(x);
  49.  
  50. Yx = (1 + 2 * Math.Pow(x, 2)) * Math.Exp(Math.Pow(x, 2));
  51.  
  52. res.Text += $"При x = {x}\tS(x) = {Math.Round(Sx, 2)}; Y(x) = {Math.Round(Yx, 2)}\r\n";
  53. }
  54. }
  55.  
  56.  
  57. }
  58. }
  59.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(9,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(13,34): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty