Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Picasoft
APIs
Init
Sh
Commits
ccb152ca
Unverified
Commit
ccb152ca
authored
Jan 17, 2019
by
Rémy Huet
💻
Browse files
Conditions sur les nombres
parent
2d49f37a
Pipeline
#33620
passed with stage
in 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/tex/conditions.tex
View file @
ccb152ca
...
...
@@ -210,3 +210,76 @@ Welcome !
\end{itemize}
\end{alertblock}
\end{frame}
\begin{frame}
[fragile]
{
Nombres
}{
Les différents test
}
\begin{table}
\centering
\begin{tabular}
{
|c|c|
}
\hline
\verb
+
Test et syntaxe
+
&
\textbf
{
Explications
}
\\
\hline\hline
\verb
+
$a -eq $b
+
&
Test d'égalité
\\
\hline
\verb
+
$a -ne $b
+
&
Test d'inégalité
\\
\hline
\verb
+
$a -lt $b
+
&
\verb
+
$a
+
inférieur à
\verb
+
$b
+
\\
\hline
\verb
+
$a -le $b
+
&
\verb
+
$a
+
inférieur ou égal à
\verb
+
$b
+
\\
\hline
\verb
+
$a -gt $b
+
&
\verb
+
$a
+
supérieur à
\verb
+
$b
+
\\
\hline
\verb
+
$a -ge $b
+
&
\verb
+
$a
+
supérieur ou égal à
\verb
+
$b
+
\\
\hline
\end{tabular}
\caption
{
Les comparaisons sur des nombres
}
\label
{
tab:comp
_
nombres
}
\end{table}
\end{frame}
\begin{frame}
[fragile]
{
Nombres
}{
Exemple
}
Dans le fichier
\texttt
{
script.sh
}
\begin{beamercolorbox}
[rounded=true, shadow=true]
{
terminal
}
\begin{Verbatim}
#!/bin/bash
read -p 'Quel est ton age ? ' age
if [
$
age
-
lt
18
]
then
echo 'Tu es mineur'
fi
if
[
$
age -ge 18 ]
then
echo 'Tu es majeur'
if [
$
age
-
eq
18
]
then
echo 'De peu
!
'
fi
fi
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
On exécute:
\begin
{
beamercolorbox
}
[
rounded
=
true, shadow
=
true
]
{
terminal
}
\begin
{
Verbatim
}
remy@hp
-
remy:~
/
scripts
$
./script.sh
\Pause
Quel est ton age ?
\Pause
14
\Pause
Tu es mineur
\Pause
remy@hp-remy:~/scripts
$
.
/
script.sh
\Pause
Quel est ton age ?
\Pause
21
\Pause
Tu es majeur
\Pause
remy@hp
-
remy:~
/
scripts
$
./script.sh
\Pause
Quel est ton age ?
\Pause
18
\Pause
Tu es majeur
De peu !
\end{Verbatim}
\end{beamercolorbox}
\begin{alertblock}
{}
On note bien que
\texttt
{
-lt
}
a vérifié que l'age était
\textbf
{
strictement
}
inférieur tandis que
\texttt
{
-ge
}
a vérifié qu'il était supérieur ou égal.
\end{alertblock}
\end{frame}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment