using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int[] test = { 3, 6, 8, 10, 2, 3 ,6 };
int count = 0;
// Random ranDuplicateChange;
for (int i = 0; i < test.Length; i++)
{
count = 0;
// Console.WriteLine(" {0} :: The current number is: {1} ", i, test[i]);
for (int j = 0; j < test.Length; j++)
{
if (test[i] == test[j])
{
count++;
if (count >= 2)
{
Response.Write ("Duplicate found: {0}"+ test[j] +"<BR>");
}
}
}
}
}
}
No comments:
Post a Comment