Advertisement
mx_1

Untitled

Mar 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 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. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. // 1
  15. int n = Int32.Parse(System.Console.ReadLine());
  16. string[] x = new string[n+1];
  17.  
  18. // 2
  19. int m = Int32.Parse(System.Console.ReadLine());
  20. string[] V = new string[m + 1];
  21.  
  22. // 3
  23. string[] U = new string[m + 1];
  24.  
  25. // 4
  26. double[,] E = new double[n + 1, m + 1];
  27.  
  28. for (int i = 1; i <= m; i++)
  29. {
  30. V[i] = i.ToString();
  31. U[i] = "Управление " + i.ToString();
  32. }
  33. for (int i = 1; i <= n; i++)
  34. {
  35. x[i] = "X" + i.ToString();
  36. }
  37. double zn;
  38. for(int i = 1; i <= m; i++)
  39. {
  40. zn = 1 / m;
  41. for (int g = n; g >= 1; g--)
  42. E[g,i] = zn;
  43. }
  44. E[0, 0] = 0;
  45. using (StreamWriter write3 = File.CreateText("output1.txt"))
  46. {
  47. for (int i = 1; i <= m; i++)
  48. write3.WriteLine("X: " + V[i]);
  49. }
  50. using (StreamWriter write1 = File.CreateText("output2.txt"))
  51. {
  52. for (int i = 1; i <= m; i++)
  53. write1.WriteLine("Состояние " + V[i]);
  54. }
  55. using (StreamWriter write2 = File.CreateText("output3.txt"))
  56. {
  57. for (int i = 1; i <= m; i++)
  58. write2.WriteLine(U[i]);
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement