<?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=1287_-_CifreGen</id>
	<title>1287 - CifreGen - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1287_-_CifreGen"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1287_-_CifreGen&amp;action=history"/>
	<updated>2026-05-01T06:37:54Z</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=1287_-_CifreGen&amp;diff=7653&amp;oldid=prev</id>
		<title>Gabii at 21:05, 4 December 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1287_-_CifreGen&amp;diff=7653&amp;oldid=prev"/>
		<updated>2023-12-04T21:05:39Z</updated>

		<summary type="html">&lt;p&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 21:05, 4 December 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-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&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;&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;Intrare&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;Intrare&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;3 &lt;/del&gt;5 3&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;  5 3 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10&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;consola&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;consola&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;quot;Nu corespunde restricțiilor&amp;quot;.&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;quot;Nu corespunde restricțiilor&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gabii</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1287_-_CifreGen&amp;diff=7652&amp;oldid=prev</id>
		<title>Gabii: Pagină nouă: = Cerința = Se dau două cifre &lt;code&gt;a b&lt;/code&gt; și un număr &lt;code&gt;n&lt;/code&gt;. Să se genereze toate numerele cu exact &lt;code&gt;n&lt;/code&gt; cifre cuprinse între &lt;code&gt;a&lt;/code&gt; și &lt;code&gt;b&lt;/code&gt;.  = Date de intrare = Programul citește de la tastatură numerele &lt;code&gt;a b n&lt;/code&gt;.  = Date de ieșire = Programul va afișa pe ecran numerele generate, câte unul pe linie, în ordine crescătoare. În cazul în care restricțiile nu sunt îndeplinite, se va afișa mesajul &quot;Nu corespun...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1287_-_CifreGen&amp;diff=7652&amp;oldid=prev"/>
		<updated>2023-12-04T21:04:51Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: = Cerința = Se dau două cifre &amp;lt;code&amp;gt;a b&amp;lt;/code&amp;gt; și un număr &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;. Să se genereze toate numerele cu exact &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; cifre cuprinse între &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;.  = Date de intrare = Programul citește de la tastatură numerele &amp;lt;code&amp;gt;a b n&amp;lt;/code&amp;gt;.  = Date de ieșire = Programul va afișa pe ecran numerele generate, câte unul pe linie, în ordine crescătoare. În cazul în care restricțiile nu sunt îndeplinite, se va afișa mesajul &amp;quot;Nu corespun...&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;
Se dau două cifre &amp;lt;code&amp;gt;a b&amp;lt;/code&amp;gt; și un număr &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;. Să se genereze toate numerele cu exact &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; cifre cuprinse între &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; și &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Date de intrare =&lt;br /&gt;
Programul citește de la tastatură numerele &amp;lt;code&amp;gt;a b n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Date de ieșire =&lt;br /&gt;
Programul va afișa pe ecran numerele generate, câte unul pe linie, în ordine crescătoare. În cazul în care restricțiile nu sunt îndeplinite, se va afișa mesajul &amp;quot;Nu corespunde restricțiilor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Restricții și precizări =&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1 ≤ n ≤ 8&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0 &amp;lt; a &amp;lt; b &amp;lt; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Exemplul 1 =&lt;br /&gt;
Intrare&lt;br /&gt;
 3 5 3&lt;br /&gt;
Ieșire&lt;br /&gt;
 333&lt;br /&gt;
 334&lt;br /&gt;
 335&lt;br /&gt;
 343&lt;br /&gt;
 344&lt;br /&gt;
 345&lt;br /&gt;
 353&lt;br /&gt;
 354&lt;br /&gt;
 355&lt;br /&gt;
 433&lt;br /&gt;
 434&lt;br /&gt;
 435&lt;br /&gt;
 443&lt;br /&gt;
 444&lt;br /&gt;
 445&lt;br /&gt;
 453&lt;br /&gt;
 454&lt;br /&gt;
 455&lt;br /&gt;
 533&lt;br /&gt;
 534&lt;br /&gt;
 535&lt;br /&gt;
 543&lt;br /&gt;
 544&lt;br /&gt;
 545&lt;br /&gt;
 553&lt;br /&gt;
 554&lt;br /&gt;
 555&lt;br /&gt;
&lt;br /&gt;
= Exemplul 2 =&lt;br /&gt;
Intrare&lt;br /&gt;
 3 5 3&lt;br /&gt;
consola&lt;br /&gt;
 &amp;quot;Nu corespunde restricțiilor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
def validate_restrictions(a, b, n):&lt;br /&gt;
    if 1 &amp;lt;= n &amp;lt;= 8 and 0 &amp;lt; a &amp;lt; b &amp;lt; 10:&lt;br /&gt;
        return True&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Nu corespunde restricțiilor&amp;quot;)&lt;br /&gt;
        return False&lt;br /&gt;
&lt;br /&gt;
# Citirea datelor de intrare&lt;br /&gt;
a = int(input(&amp;quot;Introduceți a: &amp;quot;))&lt;br /&gt;
b = int(input(&amp;quot;Introduceți b: &amp;quot;))&lt;br /&gt;
n = int(input(&amp;quot;Introduceți n: &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
# Validarea restricțiilor&lt;br /&gt;
if validate_restrictions(a, b, n):&lt;br /&gt;
    # Generarea și afișarea numerelor&lt;br /&gt;
    def generate_numbers(current_number, remaining_digits):&lt;br /&gt;
        if remaining_digits == 0:&lt;br /&gt;
            print(current_number)&lt;br /&gt;
            return&lt;br /&gt;
        for digit in range(a, b+1):&lt;br /&gt;
            generate_numbers(current_number * 10 + digit, remaining_digits - 1)&lt;br /&gt;
&lt;br /&gt;
    for starting_digit in range(a, b+1):  &lt;br /&gt;
        generate_numbers(starting_digit, n - 1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gabii</name></author>
	</entry>
</feed>