Advertisement
BojidarDosev

zadacha 2 // 6.3.2020

Mar 7th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.35 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 ConsoleApp41
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double av = 0, sum = 0;
  14.             double[,] array = new double[6, 4];
  15.             int i, j, br = 0;
  16.             for (i = 0; i < 6; i++)
  17.                 for (j = 0; j < 4; j++)
  18.                     array[i, j] = double.Parse(Console.ReadLine());
  19.             for (i = 0; i < 6; i++)
  20.             {
  21.                 for (j = 0; j < 4; j++)
  22.                     Console.Write(array[i, j] + " ");
  23.                 Console.WriteLine();
  24.             }
  25.             //a
  26.             for (i = 0; i < 6; i++)
  27.  
  28.             {
  29.                 if (array[i, 3] >= 5.50)
  30.                     br++;
  31.             }
  32.             Console.WriteLine("br na otLichnicite e : " + br);
  33.             //b
  34.             br = 0;
  35.             for (i = 0; i < 6; i++)
  36.             {
  37.                 if (array[i, 1] >= 160)
  38.                     br++;
  39.             }
  40.             Console.WriteLine("za otbora po basket sa : " + br);
  41.             //c
  42.             br = 0;
  43.             for (i = 0; i < 6; i++)
  44.             {
  45.                 if (array[i, 2] >= 65 && array[i, 0] >=11)
  46.                     br++;
  47.             }
  48.             Console.WriteLine("za otbora  po borba sa : " + br);
  49.             //d
  50.             br = 0;
  51.             for (i = 0; i < 6; i++)
  52.                 for (j = 0; j < 4; j++)
  53.                 {
  54.                     if (array[i, 0] == 9 || array[i, 0] == 10)
  55.                     {
  56.                         sum = sum + array[i, 1];
  57.                         br++;
  58.                     }
  59.                     av = sum / br;
  60.                 }
  61.  
  62.             Console.WriteLine("av = " + av);
  63.             br = 0;
  64.             //e
  65.             for (i = 0; i < 6; i++)
  66.                 for (j = 0; j < 4; j++)
  67.                 {
  68.                     br = 0;
  69.                     if (array[i, 0] == 10 || array[i, 0] == 11 && array[i, 1] >=170 && array[i, 2] <=70)
  70.                     {
  71.                         br++;
  72.                     }
  73.                 }
  74.             Console.WriteLine("furbolen otbor = " + br);
  75.         }
  76.     }
  77. }
  78. /*
  79. 9
  80. 160
  81. 60
  82. 5,55
  83. 10
  84. 165
  85. 66
  86. 4,51
  87. 9
  88. 155
  89. 54
  90. 3,85
  91. 11
  92. 166
  93. 65
  94. 4,49
  95. 12
  96. 175
  97. 80
  98. 5,50
  99. 11
  100. 180
  101. 82
  102. 3,75
  103. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement