Saucisse Floodez, floodez !

  • Auteur de la discussion Auteur de la discussion Vinsters
  • Date de début Date de début
Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int num1 = 0, num2 = 0, num3 = 0;
  int numchosen = 0, numchosen1 = 0;

  printf("SHITTY CALCULATOR V1\n\n\n");
      
  printf("\nFor addition type 1 then Enter\nFor subtraction type 2 then Enter\nFor multiplication type 3 then Enter\nFor division type 4 then Enter\n");
  scanf ("%d", &numchosen);
  switch (numchosen)
  {
      case 1:
      printf("You have chosen addition\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 + num2;
      printf("%d + %d = %d\n", num1, num2, num3);
      break;
      case 2:
        printf("You have chosen substraction\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 - num2;
      printf("%d - %d = %d\n", num1, num2, num3);
      break;
      case 3:
        printf("You have chosen multiplication\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 * num2;
      printf("%d x %d = %d\n", num1, num2, num3);
      break;
      case 4:
        printf("You have chosen division\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 / num2;
      printf("%d / %d = %d\n", num1, num2, num3);
      break;
      default:
      printf("Dumbfuck, can't even enter a number between 1 and 4");
      break;

  }
  printf("If you want to use the calculator one more time, type 1 then press Enter\nIf you want quit, type 2 then hit Enter");
  scanf("%d", &numchosen1);
  if (numchosen1 == 1)
  {
      printf("\nFor addition type 1 then Enter\nFor subtraction type 2 then Enter\nFor multiplication type 3 then Enter\nFor division type 4 then Enter\n");
      scanf ("%d", &numchosen);

  switch (numchosen)
  {
      case 1:
      printf("You have chosen addition\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 + num2;
      printf("%d + %d = %d\n", num1, num2, num3);
      break;
      case 2:
        printf("You have chosen substraction\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 - num2;
      printf("%d - %d = %d\n", num1, num2, num3);
      break;
      case 3:
        printf("You have chosen multiplication\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 * num2;
      printf("%d x %d = %d\n", num1, num2, num3);
      break;
      case 4:
        printf("You have chosen division\nType the first number then hit Enter\n");
      scanf ("%d", &num1);
      printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
      scanf("%d", &num2);
      num3 = num1 / num2;
      printf("%d / %d = %d\n", num1, num2, num3);
      break;
      default:
      printf("Dumbfuck, can't even enter a number between 1 and 4");
      break;
  }
  
}
if (numchosen1 == 2)
{
    return 0;
}
else
{
    printf("Dumb Dumbfucks Are Dumb!");

}
}
Faut dire que je code comme de la merde.
 
Code:
#include <stdio.h>
#include <stdlib.h>

// Ne pas oublier les anti-slash et non les slash !!

int main(int argc, char *argv[])
{
int resultat = 0, nombre1 = 0, nombre2 = 0, choixOperation = 0, choixEnd = 0;

do
{

printf("Ecrivez le nombre 1 :\n\n");
scanf("%d", &nombre1);
printf("Ecrivez le nombre 2 :\n\n");
scanf("%d", &nombre2);
printf("Choississez votre operation :\n\n");
printf("1. Addition .\n");
printf("2. Soustraction .\n");
printf("3. Multiplication .\n");
printf("4. Division .\n");
printf("5. Modulo .\n");
scanf("%d", &choixOperation);

switch(choixOperation)
{
case 1:
resultat = nombre1 + nombre2;
printf("%d + %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 2:
resultat = nombre1 - nombre2;
printf("%d - %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 3:
resultat = nombre1 * nombre2;
printf("%d * %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 4:
resultat = nombre1 / nombre2;
printf("%d / %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 5:
resultat = nombre1 % nombre2;
printf("%d % %d = %d\n\n", nombre1, nombre2, resultat);
break;
default:
printf("Choix Impossible");
break;

}

printf("Voulez vous faire un nouveau calcul ?\n");
printf("1. Faire un nouveau calcul\n");
printf("2. Eteindre la calculatrice\n");
scanf("%d", &choixEnd);

} while(choixEnd != 2);

return 0;

}

Voila le code de ma calculette Choco :) .
 
Code:
printf("1. Faire un nouveau calcul\n");
printf("2. Eteindre la calculatrice\n");
scanf("%d", &choixEnd);

} while(choixEnd != 2);

return 0;

}
Dans tout les cas, la calculatrice vas s'éteindre...
 
Code:
#include <stdio.h>
#include <stdlib.h>

// Ne pas oublier les anti-slash et non les slash !!

int main(int argc, char *argv[])
{
int resultat = 0, nombre1 = 0, nombre2 = 0, choixOperation = 0, choixEnd = 0;

do
{

printf("Ecrivez le nombre 1 :\n\n");
scanf("%d", &nombre1);
printf("Ecrivez le nombre 2 :\n\n");
scanf("%d", &nombre2);
printf("Choississez votre operation :\n\n");
printf("1. Addition .\n");
printf("2. Soustraction .\n");
printf("3. Multiplication .\n");
printf("4. Division .\n");
printf("5. Modulo .\n");
scanf("%d", &choixOperation);

switch(choixOperation)
{
case 1:
resultat = nombre1 + nombre2;
printf("%d + %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 2:
resultat = nombre1 - nombre2;
printf("%d - %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 3:
resultat = nombre1 * nombre2;
printf("%d * %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 4:
resultat = nombre1 / nombre2;
printf("%d / %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 5:
resultat = nombre1 % nombre2;
printf("%d % %d = %d\n\n", nombre1, nombre2, resultat);
break;
default:
printf("Choix Impossible");
break;

}

printf("Voulez vous faire un nouveau calcul ?\n");
printf("1. Faire un nouveau calcul\n");
printf("2. Eteindre la calculatrice\n");
scanf("%d", &choixEnd);

} while(choixEnd != 2);

return 0;

}

Voila le code de ma calculette Choco :) .
mais on peux calculer que 1 et 2...c'est juste une fucking fenêtre de dialogue en fait!