Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp42
- {
- class Program
- {
- static void Main(string[] args)
- {
- double max = 0,sum = 0,av = 0;
- int i, j, red = 0,br = 0;
- double[,] array = new double[5, 4];
- for (i = 0; i < 5; i++)
- for (j = 0; j < 4; j++)
- array[i, j] = double.Parse(Console.ReadLine());
- for (i = 0; i < 5; i++)
- {
- for (j = 0; j < 4; j++)
- Console.Write(array[i, j] + " ");
- Console.WriteLine();
- }
- for (i = 0; i < 5; i++)
- {
- if (array[i, 0] > max)
- {
- max = array[i, 0];
- red = i;
- }
- }
- Console.WriteLine("max radius: " + max + " na red " + (red+1));
- for (i = 0; i < 5; i++)
- {
- sum = sum + array[i, 2];
- }
- Console.WriteLine("sumata ot licata : " + sum);
- sum = 0;
- for (i = 0; i < 5; i++)
- {
- if (array[i, 0] > 0)
- {
- br++;
- sum = sum + array[i, 3];
- }
- }
- av = sum / br;
- Console.WriteLine("av na duljinite e: " + Math.Round(av, 2));
- }
- }
- }
- /*
- 1
- 2
- 3,14
- 6,28
- 3,5
- 7
- 38,47
- 21,98
- 4
- 8
- 50,24
- 25,12
- 0
- 0
- 0
- 0
- 2,2
- 4,4
- 15,20
- 13,82
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement