HELP URGENT

i have to do something in my program that would take the values of int n[5] and chech wich ones are equal to int achaven[5] and would take the value of y[2] and check wich ones are equal to int achavee[2], and then it will substitue in the matrix...
if the n[5] is equal to achaven[5] then it will appear an "O" in the matrix, otherwise it will appear and "X"
samething with the int y[2] and int achavee[2]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
case 2:
{
  printf("A sua chave eh:\n");
  fprintf(f,"\nA sua chave eh:\n\n");
  for(i=0;i<5;i++)
    {	
      printf("%d ", n[i]);
      fprintf(f,"%d ", n[i]);
    }
  printf("  ++  ");
  fprintf(f,"  ++  ");
  for(j=0;j<2;j++)
     {
       printf("%d ", y[j]);
       fprintf(f,"%d ", y[j]);
     }
   printf("\n\n");
   fprintf(f,"\n\n");
  //matrix//
  coluna=0;
  j=0;
  SetConsoleTextAttribute( h , K+141 );
  for (int i=1; i<51; i++)
     {
       if (achaven[j]==n[i])
           {
              SetConsoleTextAttribute( h , K+137 );
              printf( "    O");
              j++;
              SetConsoleTextAttribute( h , K+142 );
           }
       else if (n[i]==i)
          {
              SetConsoleTextAttribute( h , K+137 );
              printf( "    X");
              j++;
              SetConsoleTextAttribute( h , K+142 );
          }
       else
          {
              printf( " %4d", i);
          }
       coluna ++;
       if (coluna == 6)
          {
              printf("\n");
              coluna=0;
          }
      }
printf("                    ");
fprintf(f,"                    ");
printf("\n\n");
fprintf(f,"\n\n");
coluna=0;
j=0;
SetConsoleTextAttribute( h , K+142 );
for (int i=1; i<12; i++)
{
if (y[j]==i)
    {
    SetConsoleTextAttribute( h , K+137 );
printf( "    X");
fprintf(f,"    X");
j++;
SetConsoleTextAttribute( h , K+142 );
}
else
{
printf( " %4d", i);
fprintf(f," %4d", i);
}
coluna ++;
if (coluna == 3)
{
printf("\n");
fprintf(f,"\n");
coluna=0;
}
}
printf("     ");
fprintf(f,"     ");
printf("\n\n\n");
fprintf(f,"\n\n\n");
break;
}


running this program i get this in the .exe:
http://img23.imageshack.us/img23/6122/capturarry.jpg
Topic archived. No new replies allowed.