<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=0082_-_MinMax</id>
	<title>0082 - MinMax - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=0082_-_MinMax"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0082_-_MinMax&amp;action=history"/>
	<updated>2026-05-01T04:37:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=0082_-_MinMax&amp;diff=3490&amp;oldid=prev</id>
		<title>Csatari Mălina: /* Exemple */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0082_-_MinMax&amp;diff=3490&amp;oldid=prev"/>
		<updated>2023-04-13T10:55:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemple&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:55, 13 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 5&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 5&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 8 2 9 4 5&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 8 2 9 4 5&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ieșire&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ecran&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Datele sunt introduse corect.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Datele sunt introduse corect.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; minmax.out&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; minmax.out&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 2 9&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 2 9&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Exemplul 2===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Exemplul 2===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Intrare&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;minmax.in&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 5&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 5&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 8 2 9 4&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: 8 2 9 4&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ieșire&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ecran&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Datele nu corespund restricțiilor impuse.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Datele nu corespund restricțiilor impuse.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Rezolvare ==  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Rezolvare ==  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Csatari Mălina</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=0082_-_MinMax&amp;diff=3486&amp;oldid=prev</id>
		<title>Csatari Mălina: Pagină nouă: Sursa: [https://www.pbinfo.ro/probleme/82/minmax 0082 - MinMax] ---- == Cerinţa == Se citește n, apoi încă n numere întregi. Calculaţi valoarea minima minim si valoarea maxima maxim a celor n numere date. == Date de intrare == Fişierul de intrare &#039;&#039;&#039;minmax.in&#039;&#039;&#039; conţine pe prima linie numărul &#039;&#039;&#039;n&#039;&#039;&#039; si pe a doua linie n numere naturale separate prin spaţii. == Date de ieșire ==  Dacă datele sunt introduse corect, pe ecran se va afișa:  &quot;Datele sunt introduse cor...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0082_-_MinMax&amp;diff=3486&amp;oldid=prev"/>
		<updated>2023-04-13T10:30:15Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: Sursa: [https://www.pbinfo.ro/probleme/82/minmax 0082 - MinMax] ---- == Cerinţa == Se citește n, apoi încă n numere întregi. Calculaţi valoarea minima minim si valoarea maxima maxim a celor n numere date. == Date de intrare == Fişierul de intrare &amp;#039;&amp;#039;&amp;#039;minmax.in&amp;#039;&amp;#039;&amp;#039; conţine pe prima linie numărul &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; si pe a doua linie n numere naturale separate prin spaţii. == Date de ieșire ==  Dacă datele sunt introduse corect, pe ecran se va afișa:  &amp;quot;Datele sunt introduse cor...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sursa: [https://www.pbinfo.ro/probleme/82/minmax 0082 - MinMax]&lt;br /&gt;
----&lt;br /&gt;
== Cerinţa ==&lt;br /&gt;
Se citește n, apoi încă n numere întregi. Calculaţi valoarea minima minim si valoarea maxima maxim a celor n numere date.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Fişierul de intrare &amp;#039;&amp;#039;&amp;#039;minmax.in&amp;#039;&amp;#039;&amp;#039; conţine pe prima linie numărul &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; si pe a doua linie n numere naturale separate prin spaţii.&lt;br /&gt;
== Date de ieșire == &lt;br /&gt;
Dacă datele sunt introduse corect, pe ecran se va afișa: &lt;br /&gt;
&amp;quot;Datele sunt introduse corect.&amp;quot;, apoi, în fişierul de ieşire minmax.out va conţine pe prima linie două numere minim şi maxim, separate printr-un singur spaţiu. În cazul în care datele nu respectă restricțiile, se va afișa pe ecran: &amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Restricţii şi precizări ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039; &amp;lt; &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; &amp;lt; &amp;#039;&amp;#039;&amp;#039;1000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* numerele de pe a doua linie a fişierului de intrare vor fi mai mici decât &amp;#039;&amp;#039;&amp;#039;1000000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Exemple ==&lt;br /&gt;
===Exemplul 1===&lt;br /&gt;
; minmax.in&lt;br /&gt;
: 5&lt;br /&gt;
: 8 2 9 4 5&lt;br /&gt;
; Ieșire&lt;br /&gt;
: Datele sunt introduse corect.&lt;br /&gt;
; minmax.out&lt;br /&gt;
: 2 9&lt;br /&gt;
===Exemplul 2===&lt;br /&gt;
; Intrare&lt;br /&gt;
: 5&lt;br /&gt;
: 8 2 9 4&lt;br /&gt;
; Ieșire&lt;br /&gt;
: Datele nu corespund restricțiilor impuse.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Rezolvare == &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
# 0082 MinMax&lt;br /&gt;
&lt;br /&gt;
def afisare_min_max(n, vector):&lt;br /&gt;
    maxim = max(vector)&lt;br /&gt;
    minim = min(vector)&lt;br /&gt;
    with open(&amp;#039;minmax.out&amp;#039;, &amp;#039;w&amp;#039;) as out_file:&lt;br /&gt;
        out_file.write(f&amp;quot;{minim} {maxim}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def citire_conform_restrictiilor(n, vector):&lt;br /&gt;
    if n &amp;lt; 1 or n &amp;gt;= 1000:&lt;br /&gt;
        print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
        exit()&lt;br /&gt;
    for element in vector:&lt;br /&gt;
        if element &amp;gt;= 1000000:&lt;br /&gt;
            print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
            exit()&lt;br /&gt;
    if n != len(vector):&lt;br /&gt;
        print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
        exit()&lt;br /&gt;
    print(&amp;quot;Datele sunt introduse corect.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    with open(&amp;#039;minmax.in&amp;#039;, &amp;#039;r&amp;#039;) as in_file:&lt;br /&gt;
        n = int(in_file.readline().strip())&lt;br /&gt;
        vector = list(map(int, in_file.readline().strip().split()))&lt;br /&gt;
    citire_conform_restrictiilor(n, vector)&lt;br /&gt;
    afisare_min_max(n, vector)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Explicație rezolvare ==&lt;br /&gt;
    Programul de mai sus conține două funcții, funcția &amp;#039;&amp;#039;&amp;#039;afisare_min_max(n, vector)&amp;#039;&amp;#039;&amp;#039; și funcția &amp;#039;&amp;#039;&amp;#039;citire_conform_restrictiilor(n, vector)&amp;#039;&amp;#039;&amp;#039;, care se vor rula în interiorul main-ului (&amp;#039;&amp;#039;&amp;#039;if __name__ == &amp;#039;__main__&amp;#039; &amp;#039;&amp;#039;&amp;#039;, linia 24) după citirea numărului n (linia 26) și celor n numere pe care le vom pune în șirul „vector” (linia 27), pe care le citim prin deschiderea fișierului minmax.in (linia 25).&amp;lt;br&amp;gt;   După ce am citit toate datele de intrare, se va apela funcția &amp;#039;&amp;#039;&amp;#039;citire_conform_restrictiilor(n, vector)&amp;#039;&amp;#039;&amp;#039; care primește doi parametri: n și vector. Funcția verifică n între 0 și 1000 (linia 11), dacă elementele vectorului „vector” sunt mai mici decât 1000000 (liniile 14-15) și dacă n este lungimea vectorului „vector” (linia 18). Dacă oricare dintre condiții este încălcată, se va afișa pe ecran mesajul „Datele nu corespund restricțiilor impuse.” și se va ieși din program cu comanda exit(). Dacă toate condițiile sunt respectate, se va afișa mesajul „Datele sunt introduse corect.” (linia 21) și se va continua programul.&amp;lt;br&amp;gt;   Dacă s-au introdus corect datele, se va apela funcția &amp;#039;&amp;#039;&amp;#039;afisare_min_max(n, vector)&amp;#039;&amp;#039;&amp;#039; care primește ca parametrii numărul n și vectorul „vector”. Funcția calculează valoarea minimă și maximă din „vector” utilizând funcțiile predefinite din Python „min()” și „max()”. Aceste funcții returnează, respectiv, cel mai mic și cel mai mare element dintr-o listă (liniile 4, 5). Apoi, funcția deschide fișierul &amp;quot;minmax.out&amp;quot; în modul de scriere (&amp;#039;w&amp;#039;) utilizând contextul &amp;quot;with open()&amp;quot; pentru a se asigura că fișierul este închis corect la finalul execuției (linia 6). Funcția scrie valorile minimă și maximală în fișierul de ieșire utilizând metoda &amp;quot;write()&amp;quot; a obiectului de fișier. Valorile sunt scrise într-un format specific folosind interpolarea de șiruri f&amp;quot;{}&amp;quot; pentru a înlocui variabilele „minim” și „maxim” în șirul de caractere.&lt;/div&gt;</summary>
		<author><name>Csatari Mălina</name></author>
	</entry>
</feed>