Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SAFEARRAYBOUND sab[2];
- sab[0].lLbound = 1; sab[0].cElements = 500;
- sab[1].lLbound = 1; sab[1].cElements = 3;
- saNames.parray = SafeArrayCreate(VT_VARIANT, 2, sab);
- int i=0;
- int comp = 0;
- int cube1 = 0;
- int cube2 = 0;
- int c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18;
- c1 = c2 = c3 = c4 = c5 = c6 = c7 = c8 = c9 = c10 = c11 = c12 = c13 = c14 = c15 = c16 = c17 = c18 = 0;
- while (c1 <= 3 && c2 <= 3 && c3 <= 3 && c4 <= 3 && c5 <= 3 && c6 <= 3 && c7 <= 3 && c8 <= 3 && c9 <= 3 && c10 <= 3\
- && c11 <= 3 && c12 <= 3 && c13 <= 3 && c14 <= 3 && c15 <= 3 && c16 <= 3 && c17 <= 3 && c18 <= 3)
- {
- cube1 = rand() % 6 + 1;
- cube2 = rand() % 6 + 1;
- comp = cube1 * cube2;
- i++;
- if (comp = 1)
- {
- c1++;
- }
- else
- {
- if (comp = 2){
- c2++;
- }
- else
- {
- if (comp = 3)
- {
- c3++;
- }
- else
- {
- if (comp = 4)
- {
- c4++;
- }
- else
- {
- if (comp = 5)
- {
- c5++;
- }
- else
- {
- if (comp = 6)
- {
- c6++;
- }
- else
- {
- if (comp = 8)
- {
- c7++;
- }
- else
- {
- if (comp = 10)
- {
- c8++;
- }
- else
- {
- if (comp = 12)
- {
- c9++;
- }
- else
- {
- if (comp = 9)
- {
- c10++;
- }
- else
- {
- if (comp = 15)
- {
- c11++;
- }
- else
- {
- if (comp = 18)
- {
- c12++;
- }
- else
- {
- if (comp = 16)
- {
- c13++;
- }
- else
- {
- if (comp = 20)
- {
- c14++;
- }
- else
- {
- if (comp = 24)
- {
- c15++;
- }
- else
- {
- if (comp = 25)
- {
- c16++;
- }
- else
- {
- if (comp = 30)
- {
- c17++;
- }
- else
- {
- if (comp = 36)
- {
- c18++;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- wchar_t temp_str1[11]; // we assume that the maximal string length can be 10
- wchar_t temp_str2[11];
- wchar_t temp_str3[11];
- _itow(cube1, temp_str1, 10);
- _itow(cube2, temp_str2, 10);
- _itow(comp, temp_str3, 10);
- SafeArrayPutName(saNames.parray, i, temp_str1, temp_str2, temp_str3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement