(note that need to be able to achieve when bile yards with the lottery number at the same time, the color of the bile code automatically highlighted)
CodePudding user response:
Only need one can change the background color of the grid control unit gridThis is basically a variety of the basic functions of the grid
CodePudding user response:
To "automatic" is impossible, however, is his "with code logic",Certainly not fully automatic transformation "background color" controls to use you,
You this in addition to use a "form controls," a ListView control (set to "report" style), with a PictureBox custom painting, all is ok,
CodePudding user response:
Fyi://request 1: from give out of six different set of Numbers, from each group choose a number, and finally form a six digital array,
//list of all the array
//at the same time, eliminate all is even, all for the odd number of arrays,
//out of four Numbers increasing continuous (such as 8,9,10,11) array,
//is as follows:
//the first number from the 12 Numbers:, 1,3,2,4,5,6,7,8,9,10,11,12
//the second number from the 17 of figures:, 8,7,5,9,6,4,11,10,12,13,3,14,17,2,16,15,18
//the third number from the 21 of figures:, 13,10,15,16,18,11,14,12,7,19,21,17,8,22,9,20,6,23,5,24,25
//the fourth Numbers from the 20 selected:, 22,23,18,20,16,17,15,21,14,26,19,24,27,25,12,13,11,10,28,29
//the fifth Numbers from the 19 selected:, 26,25,27,29,30,28,23,24,20,22,19,31,21,17,18,32,13,15,16
//6 Numbers selected: from the Numbers of the 14, 32,33,30,31,29,28,27,26,25,24,23,22,18,21
//require 2:
//please enter the first number range of options: (several Spaces can manually enter any interval number, up to 30)
//please enter the second number range of options: (several Spaces can manually enter any interval number, up to 30)
//please enter the number 3 options: (several Spaces can manually enter any interval number, up to 30)
//please enter the fourth number range of options: you can manually enter any several space interval number, up to 30)
//please enter the fifth number range of options: (several Spaces can manually enter any interval number, up to 30)
//please enter the number range of options: (6 can manually enter any several space interval number, up to 30)
//then press enter, the output to the cp. TXT
//require 3:
//that has a different number of the same set of data,
//, for example, the first number is 6, the second number or any other number can't again for 6; The second number 10, the third number or other can't again for 10, and so on...
//require 4:
//add a condition: produced in each of the array A1A2A3A4A5A6, requires A1 & lt; A2 & lt; A3 & lt; A4 & lt; A5 & lt; A6
#include
#include
#include
Int v [6];
Int n [6]=,17,21,20,19,14 {12};
Int d [6] [30]={
,3,2,4,5,6,7,8,9,10,11,12 {1},
,7,5,9,6,4,11,10,12,13,3,14,17,2,16,15,18 {8},
13,10,15,16,18,11,14,12,7,19,21,17,8,22,9,20,6,23,5,24,25 {},
22,23,18,20,16,17,15,21,14,26,19,24,27,25,12,13,11,10,28,29 {},
26,25,27,29,30,28,23,24,20,22,19,31,21,17,18,32,13,15,16 {},
{32,33,30,31,29,28,27,26,25,24,23,22,18,21},
};
Int I, j, i0, i1, i2, i3, i2, i5, s;
Char ln [100], * t;
The FILE * f;
Int main () {
for (i=0; i<6; I++) {
Printf (" please enter the range of options: % d number for ", I + 1);
The fgets (ln, 100, stdin);
j=0;
T=strtok (ln, "");
While (1) {
If (NULL==t) break;
If (0==t [0]) continue;//jump out of an empty string when multiple Spaces between
D [I] [j]=atoi (t);
j++;
If (j>=30) break;
T=strtok (NULL, "");
}
N [I]=j;
}
F=fopen (" cp. TXT ", "w");
If (NULL==f) {
Printf (" can't generate cp. TXT! \n");
return 1;
}
Printf (" is being generated cp. TXT... ");
For (i0=0; I0 & lt; N [0]; I0 {+ +)
For (i1=0; I1 & lt; N [1]. {i1 + +)
For (i2=0; I2 & lt; N [2]. I2 + +) {
For (i3=0; I3 & lt; N [3]. I3 + +) {
For (i2=0; I4 & lt; N [4]; I2 + +) {
For (i5=0; I5 & lt; N [5]; I5 + +) {
V [0]=d [0] [i0];
V [1] [1]=d (i1);
V [2]=d [2] [i2];
V [3] [3]=d/i3.
V [4]=d [4] [i2];
V [5]=d [5] [i5];
If (0==(v [0] % 2)
& & [1] % 2 0==(v)
& & [2] % 2 0==(v)
& & [3] % 2 0==(v)
& & [4] % 2 0==(v)
& & 0==[5] % 2) (v) continue;//to exclude all is even
If (1==(v [0] % 2)
& & 1==[1] % 2 (v)
& & 1==[2] % 2 (v)
& & 1==[3] % 2 (v)
& & 1==[4] % 2 (v)
& & 1==[5] % 2) (v) continue; With odd//eliminate all
for (i=0; i<5; I++) {
For (j=I + 1; J<6; J++) {
If (v [I] [j]==v) goto NEXT;//that the same set of data are not the same number of
}
}
NEXT:
If (i> {
=5)for (i=0; i<5; I++) for (j=I + 1; J<6; J++) if (v [I] & gt; V [j]) {s=v [I]; V=v [I] [j]; V [j]=s; }//smallest
If ([0] (v + 1==v [1]
& & V + 1==v [1] [2]
& & V + 1==v [2] [3])
| | (n + 1==v [1] [2]
& & V + 1==v [2] [3]
& & V + 1==v [3] [4])
| | (n + 1==v [2] [3]
& & V + 1==v [3] [4]
& & V [4] [5] + 1==v)) continue;//out of four Numbers increasing continuous
Fprintf (f "% % % 2 d, 2 d, 2 d, 2 d %, % 2 d % 2 d \ n", v [0], v [1], v [2], v [3], v [4], v [5]);
}
}}}}}}
The fclose (f);
Printf (" \ n generated cp. TXT finished \ n ");
return 0;
}
//if the file in. TXT for the content of the
//1 2 3 4 5 6 7 8 9 10 11 12
//7 8 9 10 6 4 11 12 13 14 3 2 16 17 18
//13, 15, 16 18 November 14 12 July 19 and 17 August 22 September 20 June 23 24 25 5
//22 23 16 17 18 to 20 15 21 and 26 19 24 and 25 12 13 11 October 28, 29
//26 28 23 24 25 and 29 30 20 22 and 31 21 32 13 15 16 17 18
//30 31 32 33 27 and 28 26 23 24 25 22 18 21
//can enter commands inside the CMD window
//cp & lt; In the. TXT
//get request 1
the corresponding results//BTW: must I sixty percent! Hey hey! (^=^)