suppression ancien fichier cours Pile & File, et ajout des sujets bacs NSI
This commit is contained in:
BIN
Sujet_bac/Pratique/BNS_2025/25-NSI-23/25-NSI-23.pdf
Normal file
BIN
Sujet_bac/Pratique/BNS_2025/25-NSI-23/25-NSI-23.pdf
Normal file
Binary file not shown.
21
Sujet_bac/Pratique/BNS_2025/25-NSI-23/25-NSI-23.py
Normal file
21
Sujet_bac/Pratique/BNS_2025/25-NSI-23/25-NSI-23.py
Normal file
@@ -0,0 +1,21 @@
|
||||
def dec_to_bin(nb_dec):
|
||||
q, r = nb_dec // 2, nb_dec % 2
|
||||
if q == ...:
|
||||
return ...
|
||||
else:
|
||||
return dec_to_bin(...) + ...
|
||||
|
||||
def bin_to_dec(nb_bin):
|
||||
if len(nb_bin) == 1:
|
||||
if ... == '0':
|
||||
return 0
|
||||
else:
|
||||
return ...
|
||||
else:
|
||||
if nb_bin[-1] == '0':
|
||||
bit_droit = 0
|
||||
else:
|
||||
...
|
||||
return ... * bin_to_dec(nb_bin[:-1]) + ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user