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
Čermák Petr
Prm1
Commits
22e100e4
Commit
22e100e4
authored
Oct 08, 2020
by
cermak
Browse files
Merge with
https://gitlab.kam.mff.cuni.cz/mj/prm1/
parent
6d850118
Changes
2
Show whitespace changes
Inline
Side-by-side
02-cykly/02-cykly.tex
View file @
22e100e4
...
...
@@ -22,7 +22,11 @@
~
Pokud bychom chtěli
{
\it
příkazy
}
vynechat, můžeme místo nich napsat
{
\bf
pass
}
.
Větev
{
\bf
else
}
můžeme vynechat.
~
Pokud bychom chtěli vynechat
{
\it
příkazy,
}
můžeme místo nich napsat
{
\bf
pass
}
.
To je prázdný příkaz.
\end{frame}
...
...
02-cykly/posloupnost-max2.py
0 → 100644
View file @
22e100e4
#!/usr/bin/env python3
# Načítá čísla ze vstupu ukončená -1,
# vypíše druhé největší z nich
m1
=
0
# Zatím největší číslo
m2
=
0
# Zatím druhé největší
while
True
:
n
=
int
(
input
())
if
n
==
-
1
:
break
if
n
>=
m1
:
m1
,
m2
=
n
,
m1
elif
n
>=
m2
:
m2
=
n
print
(
m2
)
Write
Preview
Markdown
is supported
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