ChameL1oN

ЯПЛаба2_2

Mar 23rd, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ForZakaz2
  8. {
  9.  
  10. //5A-4BC;
  11.  
  12.  
  13. class Program
  14. {
  15. static void Main(string[] args)
  16. {
  17. int n = 2;
  18. int[,] A = new int[n,n];
  19. int[,] B = new int[n,n];
  20. int[,] C = new int[n,n];
  21. for (int i = 0; i < n; i++)
  22. {
  23. for (int j = 0; j < n; j++)
  24. {
  25. A[i,j] = 3;
  26. B[i,j] = 2;
  27. C[i,j] = 2;
  28. }
  29. }
  30. Console.WriteLine("A : ");
  31. Console.WriteLine(" ");
  32. Print(A);
  33. Console.WriteLine(" "); Console.WriteLine("B : ");
  34. Console.WriteLine(" ");
  35. Print(B);
  36. Console.WriteLine(" "); Console.WriteLine("C : ");
  37. Console.WriteLine(" ");
  38. Print(C);
  39. Console.WriteLine(" ");
  40. Console.WriteLine("Результат 5A-4BC ");
  41. Console.WriteLine(" ");
  42. for (int i = 0; i < n; i++)
  43. {
  44. for (int j = 0; j < n; j++)
  45. {
  46. Console.Write((5 * A[i, j] - 4 * B[i, j] * C[i, j]) + " ");
  47. }
  48. Console.WriteLine(" ");
  49. }
  50. }
  51. static void Print(int[,] a)
  52. {
  53. for (int i = 0; i < 2; i++)
  54. {
  55. for (int j = 0; j < 2; j++)
  56. {
  57. Console.Write( a[i,j] + " ");
  58. }
  59. Console.WriteLine(" ");
  60. }
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment