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 86 87 88
|
#include <iostream>
#include <stdio.h> /* printf, scanf, puts, NULL */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <cmath>
#include <ctime>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[])
{
srand(unsigned(time(0)));
int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, random, totalt;
slumpa:
random = (rand()%10)+1;
totalt = a + b + c + d + e + f + g + h + i + j;
if (random == a || random == b || random == c || random == d || random == e || random == f || random == g || random == h || random == i || random == j) {
goto slumpa;
} else if (totalt == 55) {
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
g = 0;
h = 0;
i = 0;
j = 0;
} else {
}
switch (random) {
case 1:
cout<<"Category 1"<<endl;
a = 1;
goto slumpa;
break;
case 2:
cout<<"Category 2"<<endl;
b = 2;
goto slumpa;
break;
case 3:
cout<<"Category 3"<<endl;
c = 3;
goto slumpa;
break;
case 4:
cout<<"Category 4"<<endl;
d = 4;
goto slumpa;
break;
case 5:
cout<<"Category 5"<<endl;
e = 5;
goto slumpa;
break;
case 6:
cout<<"Category 6"<<endl;
f = 6;
goto slumpa;
break;
case 7:
cout<<"Category 7"<<endl;
g = 7;
goto slumpa;
break;
case 8:
cout<<"Category 8"<<endl;
h = 8;
goto slumpa;
break;
case 9:
cout<<"Category 9"<<endl;
i = 9;
goto slumpa;
break;
case 10:
cout<<"Category 10"<<endl;
j = 10;
goto slumpa;
break;
}
}
|