Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
בדיקה כמה פעמים מערך אחד כלול במערך אחר
//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[] arr1 = new int[10] {1,2,3,1,2,3,1,2,3,3}; int[] arr2 = new int[3] {1,2,3}; int j = 0; //מונה כמות התאמות for (int y = 0; y <= arr1.Length-3; y++) { int i = 0; for (int x=0;x<=arr2.Length-1; x++) { if (arr1[y + x] == arr2[x]) i++; } if (i == arr2.Length) j++; } Console.WriteLine("arr2 is {0} times in arr1", j); } } }
run
|
edit
|
history
|
help
0
Example of dates in c#, Ejemplo de fechas en c#
ejemplo c# 2
Simple Parallel.For example
Vignere Cipher
Test equality...1
Recursive 2
Url Encode
c# with mysql
JavaScript
Talk To Jack