Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Distinct linq not used
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Write a program to filter distinct items from the array //array = [1,4,2,5,4,2,5,1,6,2,5,3,8,9,6] //Builtin array functions and LINQ are not allowed. int []array = {1,4,2,5,4,2,5,1,6,2,5,3,8,9,6}; for(int i = 0 ; i < array.Length ;i++ ) { int j; for(j =0 ; j<i ; j++) { if(array[i]==array[j]) { break; } } if(i==j) { Console.WriteLine(array[i]); } } } } }
run
|
edit
|
history
|
help
0
get weekofDay from DateTime in C#
4/03/2017
test1
Carnival 1.0
return multiple value from function
Project Euler Problem 8
IsStringAPalindrome
math 5.74
e
cs002