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 ConsoleApp22
- {
- class Program
- {
- static void Main(string[] args)
- {
- double s, p;
- int a, b, c,I=0,max=0,br=0;
- int[,] array = new int[6, 3];
- for (int i = 0; i < 6; i++)
- for (int j = 0; j < 3; j++)
- array[i, j] = int.Parse(Console.ReadLine());
- for (int i = 0; i < 6; i++)
- { for (int j = 0; j < 3; j++)
- Console.Write(array[i, j] + " ");
- Console.WriteLine();
- }
- //a
- Console.WriteLine();
- for (int i = 0; i < 6; i++)
- {
- a = array[i,0];
- b = array[i, 1];
- c = array[i, 2];
- if(a+b>c && a+c>b && b + c > a)
- {
- Console.Write((i+1) + " ");
- }
- }
- Console.WriteLine();
- Console.WriteLine("s = ");
- //b
- for (int i = 0; i < 6; i++)
- {
- a = array[i, 0];
- b = array[i, 1];
- c = array[i, 2];
- if (a + b > c && a + c > b && b + c > a)
- {
- p = (a + b + c)/2.0;
- s = Math.Sqrt(p * (p - a)*(p - b)*(p - c));
- Console.Write( (i+1)+ " " + Math.Round(s,2) + " ");
- }
- }
- //c
- Console.WriteLine();
- Console.WriteLine();
- for (int i = 0; i < 6; i++)
- {
- a = array[i, 0];
- b = array[i, 1];
- c = array[i, 2];
- if (a + b > c && a + c > b && b + c > a)
- {
- if (max < (a + b + c))
- {
- max = a + b + c;
- I = i;
- }
- }
- }
- Console.WriteLine( "max P = " + max + " na red: " + (I+1));
- //d
- for (int i = 0; i < 6; i++)
- {
- a = array[i, 0];
- b = array[i, 1];
- c = array[i, 2];
- if (a + b > c && a + c > b && b + c > a)
- {
- if (a == b && b == c)
- {
- br++;
- }
- }
- }
- Console.WriteLine( " br na ravnostrannite e = " + br);
- }
- }
- }
- //4
- //4
- //4
- //3
- //3
- //5
- //-10
- //3
- //0
- //10
- //7
- //4
- //1
- //0
- //3
- //3
- //3
- //3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement