Advertisement
salron3

Vlajnost

Apr 11th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 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.  
  8. class Program
  9. {
  10.     static void Main()
  11.     {
  12.         int n = int.Parse(Console.ReadLine());
  13.         double sum = 0;
  14.         double averageWet = 0;
  15.         double daily = 0;
  16.  
  17.         double[,] arr = new double[n,12];
  18.  
  19.         for (int i = 0; i < n; i++)
  20.         {
  21.             for (int j = 0; j < 12; j++)
  22.             {
  23.                 Console.Write("{0}.Enter value:", j + 1);
  24.                 arr[i, j] = double.Parse(Console.ReadLine());
  25.             }
  26.         }
  27.  
  28.         for (int i = 0; i < n; i++)
  29.         {
  30.             for (int j = 0; j < 12; j++)
  31.             {
  32.                 sum += arr[i, j];
  33.             }
  34.             daily = sum / 12;
  35.             averageWet += daily;
  36.             sum = 0;
  37.         }
  38.         averageWet /= n;
  39.  
  40.         Console.WriteLine("The average wet is: {0}", averageWet);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement