<?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=1546_-_mincifre</id>
	<title>1546 - mincifre - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1546_-_mincifre"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;action=history"/>
	<updated>2026-05-01T05:40:49Z</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=1546_-_mincifre&amp;diff=5491&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: /* Restricţii şi precizări */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;diff=5491&amp;oldid=prev"/>
		<updated>2023-04-29T16:17:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Restricţii şi precizări&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 16:17, 29 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-l11&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&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;br&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;br&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;== Restricţii şi precizări ==&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;== Restricţii şi precizări ==&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;*Numerele citite vor avea cel mult 10.000 de cifre.&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;*Numerele citite vor avea cel mult &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;10.000&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;de cifre.&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;/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;== Exemple ==&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;== Exemple ==&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 1===&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 1===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;diff=5490&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: /* Date de ieșire */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;diff=5490&amp;oldid=prev"/>
		<updated>2023-04-29T16:16:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Date de ieșire&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 16:16, 29 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-l8&quot;&gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&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;== Date de ieșire ==&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;== Date de ieșire ==&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;br&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;br&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;Dacă datele sunt introduse corect, pe ecran se va afișa: &quot;Datele sunt introduse corect.&quot; Fișierul de ieșire mincifre.out va conține pe prima linie numărul m, reprezentând cel mai mic număr ce se poate forma cu cifrele numărului din fișierul de intrare. În cazul în care datele nu respectă restricțiile, se va afișa: &quot;Datele nu corespund restricțiilor impuse.&quot;.&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;Dacă datele sunt introduse corect, pe ecran se va afișa: &quot;Datele sunt introduse corect.&quot; Fișierul de ieșire &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;mincifre.out&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;va conține pe prima linie numărul m, reprezentând cel mai mic număr ce se poate forma cu cifrele numărului din fișierul de intrare. În cazul în care datele nu respectă restricțiile, se va afișa: &quot;Datele nu corespund restricțiilor impuse.&quot;.&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;br&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;br&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;== Restricţii şi precizări ==&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;== Restricţii şi precizări ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;diff=3375&amp;oldid=prev</id>
		<title>Sovago Rares-Andrei: Pagină nouă: ==Cerința==  Se dă numărul natural &#039;&#039;&#039;n&#039;&#039;&#039; și se cere să se afișeze cel mai mic număr natural format din cifrele sale. == Date de intrare ==  Fișierul de intrare &#039;&#039;&#039;mincifre.in&#039;&#039;&#039; conține pe prima linie numărul &#039;&#039;&#039;n&#039;&#039;&#039;.  == Date de ieșire ==  Dacă datele sunt introduse corect, pe ecran se va afișa: &quot;Datele sunt introduse corect.&quot; Fișierul de ieșire mincifre.out va conține pe prima linie numărul m, reprezentând cel mai mic număr ce se poate forma cu cifrele...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1546_-_mincifre&amp;diff=3375&amp;oldid=prev"/>
		<updated>2023-04-10T13:58:41Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Cerința==  Se dă numărul natural &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; și se cere să se afișeze cel mai mic număr natural format din cifrele sale. == Date de intrare ==  Fișierul de intrare &amp;#039;&amp;#039;&amp;#039;mincifre.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;.  == Date de ieșire ==  Dacă datele sunt introduse corect, pe ecran se va afișa: &amp;quot;Datele sunt introduse corect.&amp;quot; Fișierul de ieșire mincifre.out va conține pe prima linie numărul m, reprezentând cel mai mic număr ce se poate forma cu cifrele...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Cerința==&lt;br /&gt;
&lt;br /&gt;
Se dă numărul natural &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; și se cere să se afișeze cel mai mic număr natural format din cifrele sale.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
&lt;br /&gt;
Fișierul de intrare &amp;#039;&amp;#039;&amp;#039;mincifre.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;.&lt;br /&gt;
&lt;br /&gt;
== Date de ieșire ==&lt;br /&gt;
&lt;br /&gt;
Dacă datele sunt introduse corect, pe ecran se va afișa: &amp;quot;Datele sunt introduse corect.&amp;quot; Fișierul de ieșire mincifre.out va conține pe prima linie numărul m, reprezentând cel mai mic număr ce se poate forma cu cifrele numărului din fișierul de intrare. În cazul în care datele nu respectă restricțiile, se va afișa: &amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Restricţii şi precizări ==&lt;br /&gt;
*Numerele citite vor avea cel mult 10.000 de cifre.&lt;br /&gt;
== Exemple ==&lt;br /&gt;
===Exemplul 1===&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.in&amp;#039;&amp;#039;&lt;br /&gt;
:1234567890&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele sunt introduse corect.&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.out&amp;#039;&amp;#039;&lt;br /&gt;
:1023456789&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exemplul 2===&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.in&amp;#039;&amp;#039;&lt;br /&gt;
:321&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele sunt introduse corect.&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.out&amp;#039;&amp;#039;&lt;br /&gt;
:123&lt;br /&gt;
&lt;br /&gt;
===Exemplul 3===&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.in&amp;#039;&amp;#039;&lt;br /&gt;
:12a34&lt;br /&gt;
; &amp;#039;&amp;#039;ecran&amp;#039;&amp;#039;&lt;br /&gt;
:Datele nu corespund restricțiilor impuse.&lt;br /&gt;
; &amp;#039;&amp;#039;mincifre.out&amp;#039;&amp;#039;&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rezolvare == &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# 1546 - mincifre&lt;br /&gt;
def valideaza_input(n):&lt;br /&gt;
    # Verificăm dacă numărul introdus are cel mult 10.000 de cifre și este un număr natural&lt;br /&gt;
    if not n.isdigit() or len(n) &amp;gt; 10000:&lt;br /&gt;
        return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
def cel_mai_mic_numar(n):&lt;br /&gt;
    # Sortăm cifrele numărului și formăm cel mai mic număr natural&lt;br /&gt;
    cifre = [0] * 10&lt;br /&gt;
    for cifra in n:&lt;br /&gt;
        cifre[int(cifra)] += 1&lt;br /&gt;
&lt;br /&gt;
    if cifre[0] == len(n):&lt;br /&gt;
        return &amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    numar_format = &amp;quot;&amp;quot;&lt;br /&gt;
    for i in range(1, 10):&lt;br /&gt;
        if cifre[i] &amp;gt; 0:&lt;br /&gt;
            numar_format += str(i)&lt;br /&gt;
            cifre[i] -= 1&lt;br /&gt;
            break&lt;br /&gt;
&lt;br /&gt;
    for i in range(10):&lt;br /&gt;
        while cifre[i] &amp;gt; 0:&lt;br /&gt;
            numar_format += str(i)&lt;br /&gt;
            cifre[i] -= 1&lt;br /&gt;
&lt;br /&gt;
    return numar_format&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    # Citim datele de intrare din fișier&lt;br /&gt;
    with open(&amp;#039;mincifre.in&amp;#039;, &amp;#039;r&amp;#039;) as f:&lt;br /&gt;
        n = f.readline().strip()&lt;br /&gt;
&lt;br /&gt;
    # Verificăm validitatea datelor de intrare&lt;br /&gt;
    if not valideaza_input(n):&lt;br /&gt;
        print(&amp;quot;Datele nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Datele sunt introduse corect.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        # Calculăm rezultatul și îl scriem în fișierul de ieșire&lt;br /&gt;
        with open(&amp;#039;mincifre.out&amp;#039;, &amp;#039;w&amp;#039;) as g:&lt;br /&gt;
            g.write(cel_mai_mic_numar(n))&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;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explicatie==&lt;br /&gt;
&lt;br /&gt;
Funcția valideaza_input primește un string n și verifică dacă acesta este un număr natural cu cel mult 10.000 de cifre. Dacă n nu este un astfel de număr, funcția va returna False, altfel va returna True.&lt;br /&gt;
&lt;br /&gt;
Funcția cel_mai_mic_numar primește un string n reprezentând un număr natural cu cel mult 10.000 de cifre și calculează cel mai mic număr natural ce poate fi format din cifrele lui n. Pentru aceasta, numărul n este convertit într-un array de frecvență a cifrelor. Mai întâi, se verifică cazul în care n conține doar cifra 0, caz în care cel mai mic număr natural ce poate fi format este 0. În caz contrar, cifrele sunt sortate astfel încât să se formeze cel mai mic număr natural posibil și acesta este returnat sub forma unui string.&lt;br /&gt;
&lt;br /&gt;
În if __name__ == &amp;#039;__main__&amp;#039;: se citesc datele de intrare din fișierul mincifre.in, se verifică dacă acestea sunt valide folosind funcția valideaza_input și se afișează un mesaj corespunzător. Dacă datele sunt valide, se calculează cel mai mic număr natural ce poate fi format din cifrele lui n folosind funcția cel_mai_mic_numar, iar rezultatul este scris în fișierul de ieșire mincifre.out.&lt;/div&gt;</summary>
		<author><name>Sovago Rares-Andrei</name></author>
	</entry>
</feed>