<?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=0448_-_Cif_Ord</id>
	<title>0448 - Cif Ord - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=0448_-_Cif_Ord"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0448_-_Cif_Ord&amp;action=history"/>
	<updated>2026-05-01T07:44:25Z</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=0448_-_Cif_Ord&amp;diff=5569&amp;oldid=prev</id>
		<title>Tuca Liviu Razvan: /* Rezolvare ver. 1 */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0448_-_Cif_Ord&amp;diff=5569&amp;oldid=prev"/>
		<updated>2023-04-29T19:18:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rezolvare ver. 1&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 19:18, 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-l39&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&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;     numar = int(input(&amp;#039;Introduceti un numar de 3 cifre: &amp;#039;))  # Citim un numar de la tastatura&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;     numar = int(input(&amp;#039;Introduceti un numar de 3 cifre: &amp;#039;))  # Citim un numar de la tastatura&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;     if validare(numar):  # Aplicam functia de validare pentru numarul introdus&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;     if validare(numar):  # Aplicam functia de validare pentru numarul introdus&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;         print(&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;         print(&quot;Datele de intrare corespund restricțiilor impuse.&quot;)  # Afisam un mesaj de confirmare a validarii numarului&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;            &lt;/del&gt;&quot;Datele de intrare corespund restricțiilor impuse.&quot;)  # Afisam un mesaj de confirmare a validarii numarului&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;         cifre_ordonate(numar)  # Aplicam functia de ordonare a cifrelor numarului&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;         cifre_ordonate(numar)  # Aplicam functia de ordonare a cifrelor numarului&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;     else:&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;     else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tuca Liviu Razvan</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=0448_-_Cif_Ord&amp;diff=5566&amp;oldid=prev</id>
		<title>Tuca Liviu Razvan: Pagină nouă: ==Cerință== Se citește de la tastatură un &#039;&#039;&#039;număr natural&#039;&#039;&#039; de 3 cifre. Să se afișeze &#039;&#039;&#039;cifrele&#039;&#039;&#039; sale în ordine &#039;&#039;&#039;crescătoare&#039;&#039;&#039;.  ==Date de intrare== Programul va citi de la tastatură un &#039;&#039;&#039;număr natural&#039;&#039;&#039;, de 3 cifre.  ==Date de ieșire== Dacă datele sunt introduse corect, pe ecran se va afișa: &quot;Datele de intrare corespund restricțiilor impuse.&quot; și programul afișează pe ecran cifrele numărului citit, în ordine &#039;&#039;&#039;crescătoare&#039;&#039;&#039;, separate prin exac...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0448_-_Cif_Ord&amp;diff=5566&amp;oldid=prev"/>
		<updated>2023-04-29T19:11:54Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Cerință== Se citește de la tastatură un &amp;#039;&amp;#039;&amp;#039;număr natural&amp;#039;&amp;#039;&amp;#039; de 3 cifre. Să se afișeze &amp;#039;&amp;#039;&amp;#039;cifrele&amp;#039;&amp;#039;&amp;#039; sale în ordine &amp;#039;&amp;#039;&amp;#039;crescătoare&amp;#039;&amp;#039;&amp;#039;.  ==Date de intrare== Programul va citi de la tastatură un &amp;#039;&amp;#039;&amp;#039;număr natural&amp;#039;&amp;#039;&amp;#039;, de 3 cifre.  ==Date de ieșire== Dacă datele sunt introduse corect, pe ecran se va afișa: &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot; și programul afișează pe ecran cifrele numărului citit, în ordine &amp;#039;&amp;#039;&amp;#039;crescătoare&amp;#039;&amp;#039;&amp;#039;, separate prin exac...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Cerință==&lt;br /&gt;
Se citește de la tastatură un &amp;#039;&amp;#039;&amp;#039;număr natural&amp;#039;&amp;#039;&amp;#039; de 3 cifre. Să se afișeze &amp;#039;&amp;#039;&amp;#039;cifrele&amp;#039;&amp;#039;&amp;#039; sale în ordine &amp;#039;&amp;#039;&amp;#039;crescătoare&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==Date de intrare==&lt;br /&gt;
Programul va citi de la tastatură un &amp;#039;&amp;#039;&amp;#039;număr natural&amp;#039;&amp;#039;&amp;#039;, de 3 cifre.&lt;br /&gt;
&lt;br /&gt;
==Date de ieșire==&lt;br /&gt;
Dacă datele sunt introduse corect, pe ecran se va afișa: &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot; și programul afișează pe ecran cifrele numărului citit, în ordine &amp;#039;&amp;#039;&amp;#039;crescătoare&amp;#039;&amp;#039;&amp;#039;, separate prin exact un spațiu.În caz contrar, se va afișa pe ecran: &amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Restricții și precizări==&lt;br /&gt;
*Numărul citit de la tastatură este &amp;#039;&amp;#039;&amp;#039;natural&amp;#039;&amp;#039;&amp;#039;, de &amp;#039;&amp;#039;&amp;#039;3 cifre&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Exemplul 1==&lt;br /&gt;
;Intrare&lt;br /&gt;
&lt;br /&gt;
:101&lt;br /&gt;
&lt;br /&gt;
;Ieșire&lt;br /&gt;
:Datele de intrare corespund restricțiilor impuse.&lt;br /&gt;
:0 1 1&lt;br /&gt;
&lt;br /&gt;
==Rezolvare==&lt;br /&gt;
===Rezolvare ver. 1===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
def validare(numar):  # Cream o functie de validare ca sa ne asiguram ca numarul introdus se afla in restrictiile impuse&lt;br /&gt;
    if 100 &amp;lt;= numar &amp;lt;= 999:&lt;br /&gt;
        return True&lt;br /&gt;
    return False&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def cifre_ordonate(numar):&lt;br /&gt;
    cifre = [int(d) for d in str(numar)]  # transforma numarul intr-o lista de cifre&lt;br /&gt;
    cifre.sort()  # sorteaza cifrele in ordine crescatoare&lt;br /&gt;
    rezultat = &amp;#039; &amp;#039;.join(map(str, cifre))  # transforma cifrele in string-uri si le concateneaza cu un spatiu intre ele&lt;br /&gt;
    print(rezultat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    numar = int(input(&amp;#039;Introduceti un numar de 3 cifre: &amp;#039;))  # Citim un numar de la tastatura&lt;br /&gt;
    if validare(numar):  # Aplicam functia de validare pentru numarul introdus&lt;br /&gt;
        print(&lt;br /&gt;
            &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot;)  # Afisam un mesaj de confirmare a validarii numarului&lt;br /&gt;
        cifre_ordonate(numar)  # Aplicam functia de ordonare a cifrelor numarului&lt;br /&gt;
    else:&lt;br /&gt;
        print(&lt;br /&gt;
            &amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)  # Afisam un mesaj de eroare pentru numarul invalid.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tuca Liviu Razvan</name></author>
	</entry>
</feed>