Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Liczba powtórzająca
//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) { //Your code goes here Console.WriteLine("Hello, world!"); int [] a = new int [] {1,2,3,3}; int [] b = new int [a.Max()+1]; for ( int i = 0; i < a.Length ; i++ ) { b[a[i]] += 1; } int maxIndex = b.ToList().IndexOf(b.Max()); if ( b.Max() == 1 ) { Console.WriteLine ( " Nie ma liczb powtórzająca " ); } else { Console.WriteLine (" liczba powtórzająca najczęściej jest "+ maxIndex ); } } } }
run
|
edit
|
history
|
help
0
test 1
Secure random string
Interface
CommandForce1
alop
ADCSXAA
D16
Expression Tree - Demo1
Explanation about Aggregate method in C#
datetime