Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Arrays Solved
//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 i=0; int p=0; int f=0; int[] arr= {1,3,2,99,4,7}; int[] arr2={1,7,5,3,8,9,3,4}; int[] arr3= new int[14]; int[] arr4= new int[14]; int[] arr5= new int[14]; for( i=0;i<arr.Length;i++){ arr3[i]=arr[i]; } for(int j=0;j<arr2.Length;j++){ arr3[i]=arr2[j]; i++; } for( int q=0;q<arr3.Length;q++){ for( int k=q+1;k<arr3.Length;k++){ if(arr3[q]<arr3[k]){ p=arr3[q]; arr3[q]=arr3[k]; arr3[k]=p; } } } Console.WriteLine("DEC ORDER"); for(f=0;f<arr3.Length;f++){ Console.Write(arr3[f]+" "); } f--; Console.WriteLine(""); Console.WriteLine("MIN AND MAX VALUES "); Console.WriteLine(); Console.WriteLine(arr3[f]+"MAX "); Console.WriteLine(arr3[arr3.Length-(arr3.Length-1)]+"MIN "); for( int q=0;q<arr3.Length;q++){ int b=1; for( int k=q+1;k<arr3.Length;k++){ if(arr3[q]==arr3[k]){ b++; } } if(b>1){ Console.WriteLine(); Console.Write(arr3[q]+" Repeats "+b+" Times"); } } /// int a=0; int l=0; for(f=0;f<arr3.Length;f++){ if(arr3[f]%2==0){ arr4[a]=arr3[f]; a++; } else{ arr5[l]=arr3[f]; l++; } } Console.WriteLine("EVEN"); for(int o=0;o<arr4.Length;o++){ Console.Write(arr4[o]); } Console.WriteLine("ODD"); for(int o=0;o<arr5.Length;o++){ Console.Write(arr5[o]); } //// } } }
run
|
edit
|
history
|
help
0
display xml : linq
Linked list problem with remove
15
//Json Get Field from Array
a6
Big numbers
dsfsdfdf
Fórum ➡ GroupJoin'ing Books and Orders ( with Zip'ped output ) ♦
Fórum ➡ GroupJoin ➡ Join ➡ Easily ‼
custom Queue Implementation