Skip to content
Snippets Groups Projects
Commit 17118fa1 authored by François Lasota's avatar François Lasota
Browse files

Code PGCD + bo, lstset à améliorer

parent bb4b1b5c
Branches
No related tags found
No related merge requests found
...@@ -18,6 +18,8 @@ François LASOTA} ...@@ -18,6 +18,8 @@ François LASOTA}
\newcommand{\strong}[1]{\textbf{#1}\xspace} \newcommand{\strong}[1]{\textbf{#1}\xspace}
\renewcommand{\contentsname}{Table des matières} \renewcommand{\contentsname}{Table des matières}
\lstset{language=Python,basicstyle=\ttfamily\footnotesize ,firstnumber=0,commentstyle=\color{gray},keywordstyle=\color{magenta},numbers=left}
\begin{document} \begin{document}
\maketitle \maketitle
\tableofcontents \tableofcontents
...@@ -218,7 +220,7 @@ Il a été énoncé par Euclide dans son livre \textit{Les Éléments} numéro V ...@@ -218,7 +220,7 @@ Il a été énoncé par Euclide dans son livre \textit{Les Éléments} numéro V
\begin{lstlisting}[language=Python] \begin{lstlisting}[language=Python]
def PGCD(A,B): # On assume que A>B def PGCD(A,B): # On assume que A>B
E=[] # Je n'ai pas fait l'algorithme humain, mais un algorithme plus efficace pour les ordinateurs E=[] # Je n'ai pas fait l'algorithme humain, mais un algorithme plus efficace en code
for i in range(A): for i in range(A):
if A%i==0 and B%i==0: # Si Le nombre est diviseurs de A et B. if A%i==0 and B%i==0: # Si Le nombre est diviseurs de A et B.
E.append(i) E.append(i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment