Kosty_Fomin

Untitled

Nov 2nd, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Veronickka
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main (string[] args)
  8.         {
  9.             double[] array = new double[6];
  10.             int count = 0,  t= 0;
  11.             double s = 0;
  12.             for(int i = 0;i<6;i++){
  13.                
  14.                 double.TryParse(Console.ReadLine(),out array[i]);
  15.         }
  16.  
  17.  
  18.             for (int i = 0; i < 6; i++) {
  19.                
  20.                 if (Math.Abs (array [i]) < 1) {
  21.                     count++;
  22.                     s += array [i];
  23.                 }
  24.  
  25.                 if (array [i] == 0) {
  26.                     t++;
  27.                 }
  28.            
  29.            
  30.             }
  31.             Console.WriteLine (count+"\t"+s/count+"\t"+t);
  32.         }
  33.    
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment