Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (void)
- {
- int J1Pion1,J1Pion2,J1Pion3,J1Pion4,J1Pion5;
- int J2Pion1,J2Pion2,J2Pion3,J2Pion4,J2Pion5;
- int i;
- int t;
- int trouver;
- t=10;
- trouver=0;
- printf("Entrez J1Pion1:");
- scanf("%d",&J1Pion1);
- while((J1Pion1<1 || J1Pion1>4))
- {
- printf("Commande incorrecte.Réecrire J1Pion1 :\n");
- scanf("%d",&J1Pion1);
- }
- printf("Entrez J1Pion2:");
- scanf("%d",&J1Pion2);
- while((J1Pion2<1 || J1Pion2>4))
- {
- printf("Commande incorrecte.Réecrire J1Pion2 :\n");
- scanf("%d",&J1Pion2);
- }
- printf("Entrez J1Pion3:");
- scanf("%d",&J1Pion3);
- while((J1Pion3<1 || J1Pion3>4))
- {
- printf("Commande incorrecte.Réecrire J1Pion3 :\n");
- scanf("%d",&J1Pion3);
- }
- printf("Entrez J1Pion4:");
- scanf("%d",&J1Pion4);
- while((J1Pion4<1 || J1Pion4>4))
- {
- printf("Commande incorrecte.Réecrire J1Pion4 :\n");
- scanf("%d",&J1Pion4);
- }
- printf("Entrez J1Pion5:");
- scanf("%d",&J1Pion5);
- while((J1Pion5<1 || J1Pion5>4))
- {
- printf("Commande incorrecte.Réecrire J1Pion5 :\n");
- scanf("%d",&J1Pion5);
- }
- printf("Entrez les valeurs de J2:\n");
- while(J2Pion1!=J1Pion1 || J2Pion2!=J1Pion2 || J2Pion3!=J1Pion3 || J2Pion4!=J1Pion4 || J2Pion5!=J1Pion5 )
- {if(t>0)
- {
- printf("Entrez J2Pion1:");
- scanf("%d",&J2Pion1);
- while((J2Pion1<1 || J2Pion1>4))
- {
- printf("Commande incorrecte.Réecrire J2Pion1 :\n");
- scanf("%d",&J2Pion1);
- }
- if(J2Pion1 != J1Pion1)
- {
- printf("C'est faux\n");
- }
- else
- {
- (printf("C'est bon !\n"));
- }
- printf("Entrez J2Pion2:");
- scanf("%d",&J2Pion2);
- while((J2Pion2<1 || J2Pion2>4))
- {
- printf("Commande incorrecte.Réecrire J2Pion2 :\n");
- scanf("%d",&J2Pion2);
- }
- if(J2Pion2 != J1Pion2)
- {
- printf("C'est faux\n");
- }
- else
- {
- (printf("C'est bon !\n"));
- }
- printf("Entrez J2Pion3:");
- scanf("%d",&J2Pion3);
- while((J2Pion3<1 || J2Pion3>4))
- {
- printf("Commande incorrecte.Réecrire J2Pion3 :\n");
- scanf("%d",&J2Pion3);
- }
- if(J2Pion3 != J1Pion3)
- {
- printf("C'est faux\n");
- }
- else
- {
- (printf("C'est bon !\n"));
- }
- printf("Entrez J2Pion4:");
- scanf("%d",&J2Pion4);
- while((J2Pion4<1 || J2Pion4>4))
- {
- printf("Commande incorrecte.Réecrire J2Pion4 :\n");
- scanf("%d",&J2Pion4);
- }
- if(J2Pion4 != J1Pion4)
- {
- printf("C'est faux\n");
- }
- else
- {
- (printf("C'est bon !\n"));
- }
- printf("Entrez J2Pion5:");
- scanf("%d",&J2Pion5);
- while((J2Pion5<1 || J2Pion5>4))
- {
- printf("Commande incorrecte.Réecrire J2Pion5 :\n");
- scanf("%d",&J2Pion5);
- }
- if(J2Pion1 != J1Pion1)
- {
- printf("C'est faux\n");
- }
- else
- {
- (printf("C'est bon !\n"));
- }
- t--;
- printf("Il reste %d tentative(s)\n",t);
- }
- else
- {
- trouver=1;
- printf("Vous n'avez plus de tentatives\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement