alyscst Posted March 4, 2022 Posted March 4, 2022 Coucou, j'ai essayé de faire le concours blanc d'informatique tout à l'heure et ça ma mis une grosse claque, je n'ai réussit que le premier exercice et tout le reste rien. Je voulais savoir si ceux qui ont réussit si ils voudraient bien poster leurs programmes pour que je puisse m'entraîner et essayer de comprendre. Merci d'avance Quote
Ancien Responsable Matière Solution bunot Posted March 4, 2022 Ancien Responsable Matière Solution Posted March 4, 2022 Je suis désolé je sais pas partager les programmes j'ai pas mieux qu'un bon vieux copier/coller (attention les yeux) Peindre le motif 2 : x=y=0 for i in range(14): if surCaseMarquee(): peindreCase() est() for i in range(14): if surCaseMarquee(): x = colonneRobot() y+=1 ouest() z = x + y nord() for i in range(8): w = True for i in range (14): if surCaseMarquee() and not(x < colonneRobot() < z): w = False est() y = x = 0 for i in range(14): if surCaseMarquee(): if w == True: peindreCase() x = colonneRobot() y+=1 ouest() z = x + y nord() Lui il est plus court ça va C'est chiffre manquant: for i in range(5): ligne = input() bunot = ligne.split(" ") y = 0 for i in range (9): w = False y +=1 for x in range(len(bunot)): if bunot[x] == str(y): w = True if w == False: print(y) Et enfin tour de Hanoï (d'ailleurs si quelqu'un a plus court j'aimerais bien voir car il fait 100 blocs pile c'est vraiment pas passé loin...): bulot = [[4,3,2,1],[0]*4,[0]*4] for i in range (6): ligne = input() x = int(ligne[0])-1 y = int(ligne[2])-1 w = v = False for u in range(4): if bulot[x][-u-1] != 0 and w == False: nombre = bulot[x][-u-1] bulot[x][-u-1] = 0 w = True for u in range(4): if bulot[y][u] == 0 and v == False: bulot[y][u] = nombre v = True for i in range (3): sortie = "" for u in range(4): if bulot[i][u] != 0: sortie += str(bulot[i][u])+" " print(sortie) Quote
alyscst Posted March 4, 2022 Author Posted March 4, 2022 il y a 9 minutes, bunot a dit : Je suis désolé je sais pas partager les programmes j'ai pas mieux qu'un bon vieux copier/coller (attention les yeux) Peindre le motif 2 : x=y=0 for i in range(14): if surCaseMarquee(): peindreCase() est() for i in range(14): if surCaseMarquee(): x = colonneRobot() y+=1 ouest() z = x + y nord() for i in range(8): w = True for i in range (14): if surCaseMarquee() and not(x < colonneRobot() < z): w = False est() y = x = 0 for i in range(14): if surCaseMarquee(): if w == True: peindreCase() x = colonneRobot() y+=1 ouest() z = x + y nord() Lui il est plus court ça va C'est chiffre manquant: for i in range(5): ligne = input() bunot = ligne.split(" ") y = 0 for i in range (9): w = False y +=1 for x in range(len(bunot)): if bunot[x] == str(y): w = True if w == False: print(y) Et enfin tour de Hanoï (d'ailleurs si quelqu'un a plus court j'aimerais bien voir car il fait 100 blocs pile c'est vraiment pas passé loin...): bulot = [[4,3,2,1],[0]*4,[0]*4] for i in range (6): ligne = input() x = int(ligne[0])-1 y = int(ligne[2])-1 w = v = False for u in range(4): if bulot[x][-u-1] != 0 and w == False: nombre = bulot[x][-u-1] bulot[x][-u-1] = 0 w = True for u in range(4): if bulot[y][u] == 0 and v == False: bulot[y][u] = nombre v = True for i in range (3): sortie = "" for u in range(4): if bulot[i][u] != 0: sortie += str(bulot[i][u])+" " print(sortie) Merci beaucoup vraiment je vais essayer de comprendre ! bunot 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.