Advertisement
CapitanDniwe

Untitled

Sep 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 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.             Console.WriteLine("Вводите");
  14.             String a = Console.ReadLine();
  15.             Char b = ' ';
  16.             String[] c = a.Split(b);
  17.             int z = 0;
  18.             double y = 0;
  19.             double x = 0;
  20.             double k = 0;
  21.            
  22.             while (z<c.Length)
  23.             {
  24.  
  25.                 if (Char.IsNumber(c[z],0)== true)
  26.                 {
  27.                     x = Convert.ToDouble(c[z]);
  28.                     y = y + x;
  29.                     k = k + 1;
  30.                 }
  31.                 z = z + 1;
  32.             }
  33.             Console.WriteLine(y*10 / k);
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement