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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
#include <stdio.h>
#include <stdlib.h>
void flush() {
while (getchar() != '\n');
}
int main (){
char choix_activation = 'n';
int activation1 = 123654789;
int activation2 = 147852369;
int activation3 = 987456321;
int activation4 = 963258741;
int activation5 = 456987123;
int activation6 = 456321789;
int activation7 = 852369741;
int activation8 = 852147963;
int activation9 = 659863145;
int activation10 = 95147523;
int code = 0;
int choix = 0;
printf("veuillez entrer un nombre entre 1 et 100 \n");
do{
scanf("%i", &choix);
flush();
if (choix<101 && choix>0){
}
else {
printf("erreur dans le choix, veuillez recommencer \n");
}
}while (choix>100 || choix<1);
do{
printf("pour activer la bombe, appuyez sur o\n");
scanf("%c", &choix_activation);
flush();
}while (choix_activation != 'o');
system("cls");
if (choix>0 && choix<11){
printf("le code est %i\n", activation1);
printf("code: ");
scanf("%i", &code);
if (code == activation1){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>10 && choix<21){
printf("le code est %i\n", activation2);
printf("code: ");
scanf("%i", &code);
if (code == activation2){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>20 && choix<31){
printf("le code est %i\n", activation3);
printf("code: ");
scanf("%i", &code);
if (code == activation3){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>30 && choix<41){
printf("le code est %i\n", activation4);
printf("code: ");
scanf("%i", &code);
if (code == activation4){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>40 && choix<51){
printf("le code est %i\n", activation5);
printf("code: ");
scanf("%i", &code);
if (code == activation5){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>50 && choix<61){
printf("le code est %i\n", activation6);
printf("code: ");
scanf("%i", &code);
if (code == activation6){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>60 && choix<71){
printf("le code est %i\n", activation7);
printf("code: ");
scanf("%i", &code);
if (code == activation7){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>70 && choix<81){
printf("le code est %i\n", activation8);
printf("code: ");
scanf("%i", &code);
if (code == activation8){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>80 && choix<91){
printf("le code est %i\n", activation9);
printf("code: ");
scanf("%i", &code);
if (code == activation9){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
else if (choix>90 && choix<101){
printf("le code est %i\n", activation10);
printf("code: ");
scanf("%i", &code);
if (code == activation10){
system("cls");
goto reussi;
}
else {
goto echoue;
}
}
reussi:system("cls");
printf("\n\n\n\n BOMBE DESAMORCEE\n\n\n\n\n\n\n\n\n\n\n\n");
system("PAUSE");
return 0;
echoue:system("cls");
printf("\n\n\n\nPERDU\n\n\n\n\n\n\n\n\n\n\n\n");
system("pause");
return 0;
} |
Partager