Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
01-SI
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int[] tablo = {2,4,5,31,46,4,31,6,7,322,3,214,543,2,3}; //int[] tablo={1,2,3,4,5,16}; //31 int suma=0; for(int i =0; i< tablo.Length; i++) suma+=tablo[i]; double srednia = (double)suma/tablo.Length; double war = 0; double odchylenie = 0; foreach (int elem in tablo) war = (elem - srednia)*(elem-srednia)/tablo.Length; odchylenie = Math.Sqrt(war); Console.WriteLine("Suma = " + suma); Console.WriteLine("średnia = " + srednia); Console.WriteLine("Wariancja = " + war); Console.WriteLine("odchylenie = " + odchylenie); } } }
run
|
edit
|
history
|
help
0
PERSHENDETJE
Amortizacion de prestamos con el metodo Frances
array print 2nd half first and 1 half later
a.i. neural framework / J.A.R.V.I.S. / Just A Rather Very Intelligent System
Parsing a multi-line text file with comments
Sort A List of Ages of Students (Solution: Stack / O(N^3) Complexity)
Generics
Command design pattern
axasxasxasaxsd
MonitorPulse.cs