int aa = 0;
int bb = 0;
private void CheckNumber(string currect, string guest)
{
int cc, gg,kk,i=0;
string ss;
string[] s1 = new string[4];
string[] s2 = new string[4];
cc = Convert.ToInt32(currect);
gg = Convert.ToInt32(guest);
kk = cc - gg;
if (kk == 0)
aa = 4;
else
{
do
{
s1[i] = currect.Substring(i, 1);
s2[i] = guest.Substring(i, 1);
if (s1[i] == s2[i])
aa++;
i++;
}while(i<4);
if ((s1[0] == s2[1]) || (s1[0] == s2[2]) || (s1[0] == s2[3]))
bb++;
if ((s1[1] == s2[0]) || (s1[1] == s2[2]) || (s1[1] == s2[3]))
bb++;
if ((s1[2] == s2[0]) || (s1[2] == s2[1]) || (s1[2] == s2[3]))
bb++;
if ((s1[3] == s2[0]) || (s1[3] == s2[1]) || (s1[3] == s2[2]))
bb++;
}
}
|