Advertisement
BojidarDosev

zad 4 1.3.2020.

Mar 1st, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 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 ConsoleApp3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double max = 0;
  14.             int i, j;
  15.             double[,] array = new double[5, 4];
  16.             for(i = 0; i<5; i++)
  17.             {
  18.                 array[i, 0] = double.Parse(Console.ReadLine());
  19.                 array[i, 1] = array[i, 0] * 2;
  20.                 array[i, 2] = Math.Round(Math.PI * Math.Pow(array[i, 0], 2),2);
  21.                 array[i, 3] = Math.Round(Math.PI * array[i, 1],2);
  22.             }
  23.             for (i = 0; i < 5; i++)
  24.             {
  25.                 for (j = 0; j < 4; j++)
  26.                     Console.Write(array[i, j] + " ");
  27.                 Console.WriteLine();
  28.             }
  29.             for (i = 0; i < 5; i++)
  30.             {
  31.                 if (max < array[i, 0]) max = array[i, 0];
  32.             }
  33.             Console.WriteLine("nai golemiqt radius e " + max);
  34.         }
  35.     }
  36. }
  37. //1
  38. //3,5
  39. //4
  40. //0
  41. //2,2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement