Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. StreamWriter sr = new StreamWriter("TestFile.txt");
  14. double x1 = 0;
  15. double x2 = 69;
  16. double n = 44;
  17. Console.WriteLine("Ограничение для b: b <> 10 или -10");
  18. Console.WriteLine("Ограничение для c: c <> ((c<-9) & (c>-5))");
  19. Console.Write("b=");
  20. double b = Convert.ToDouble(Console.ReadLine());
  21. Console.Write("c=");
  22. double c = Convert.ToDouble(Console.ReadLine());
  23. double sh = (x2 - x1) / n;
  24. double f;
  25. double t;
  26. double k;
  27. double s;
  28. double x = x1;
  29.  
  30. if (b == 10 || b == -10)
  31. {
  32. Console.WriteLine("Ошибка");
  33. sr.Close();
  34. }
  35. else
  36. if ((c > -9) & (c < -5))
  37. {
  38. Console.WriteLine("Ошибка");
  39.  
  40. }
  41. else
  42. for (int _i = 0; _i < n; _i++)
  43. {
  44. f = 100 / (b * b - 100);
  45. k = Math.Sqrt((c + 9) * (c + 5));
  46. t = Math.Sin(4 * x / k);
  47. s = f * t;
  48. x = x + sh;
  49.  
  50. sr.WriteLine(s);
  51. }
  52. sr.Close();
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement