<?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=0245_-_Nr_Div_Max</id>
	<title>0245 - Nr Div Max - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=0245_-_Nr_Div_Max"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0245_-_Nr_Div_Max&amp;action=history"/>
	<updated>2026-05-01T07:33:48Z</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=0245_-_Nr_Div_Max&amp;diff=3408&amp;oldid=prev</id>
		<title>Robert Manc at 10:27, 11 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0245_-_Nr_Div_Max&amp;diff=3408&amp;oldid=prev"/>
		<updated>2023-04-11T10:27:34Z</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 10:27, 11 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-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&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;: 20&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;: 20&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;; 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;; Ieșire&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;: Datele &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;introduse &lt;/del&gt;corespund restricțiilor impuse.&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;: Datele &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de intrare &lt;/ins&gt;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;: 12&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;: 12&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;== Explicație ==  &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;== Explicație ==  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Robert Manc</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=0245_-_Nr_Div_Max&amp;diff=914&amp;oldid=prev</id>
		<title>Robert Manc: Pagină nouă: == Cerinţa == Se dă un număr natural &#039;&#039;&#039;numar&#039;&#039;&#039;. Să se determine numărul din intervalul &#039;&#039;&#039;[1,numar]&#039;&#039;&#039; care are număr maxim de divizori. Dacă există mai multe asemenea numere, se va afișa cel mai mic dintre ele. == Date de intrare == Programul citește de la tastatură un număr natural numit ”&#039;&#039;&#039;numar&#039;&#039;&#039;”. == Date de ieşire == Programul va afișa pe ecran valoarea cerută. == Restricții și precizări == * numar &amp;isin; &amp;Nu; * 0 &amp;les; numar &amp;les; 100.000 == E...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0245_-_Nr_Div_Max&amp;diff=914&amp;oldid=prev"/>
		<updated>2023-03-16T17:48:24Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Cerinţa == Se dă un număr natural &amp;#039;&amp;#039;&amp;#039;numar&amp;#039;&amp;#039;&amp;#039;. Să se determine numărul din intervalul &amp;#039;&amp;#039;&amp;#039;[1,numar]&amp;#039;&amp;#039;&amp;#039; care are număr maxim de divizori. Dacă există mai multe asemenea numere, se va afișa cel mai mic dintre ele. == Date de intrare == Programul citește de la tastatură un număr natural numit ”&amp;#039;&amp;#039;&amp;#039;numar&amp;#039;&amp;#039;&amp;#039;”. == Date de ieşire == Programul va afișa pe ecran valoarea cerută. == Restricții și precizări == * numar ∈ Ν * 0 ⩽ numar ⩽ 100.000 == E...&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 dă un număr natural &amp;#039;&amp;#039;&amp;#039;numar&amp;#039;&amp;#039;&amp;#039;. Să se determine numărul din intervalul &amp;#039;&amp;#039;&amp;#039;[1,numar]&amp;#039;&amp;#039;&amp;#039; care are număr maxim de divizori. Dacă există mai multe asemenea numere, se va afișa cel mai mic dintre ele.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Programul citește de la tastatură un număr natural numit ”&amp;#039;&amp;#039;&amp;#039;numar&amp;#039;&amp;#039;&amp;#039;”.&lt;br /&gt;
== Date de ieşire ==&lt;br /&gt;
Programul va afișa pe ecran valoarea cerută.&lt;br /&gt;
== Restricții și precizări ==&lt;br /&gt;
* numar &amp;amp;isin; &amp;amp;Nu;&lt;br /&gt;
* 0 &amp;amp;les; numar &amp;amp;les; 100.000&lt;br /&gt;
== Exemplu ==&lt;br /&gt;
; Intrare&lt;br /&gt;
: 20&lt;br /&gt;
; Ieșire&lt;br /&gt;
: Datele introduse corespund restricțiilor impuse.&lt;br /&gt;
: 12&lt;br /&gt;
== Explicație == &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;12&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;18&amp;#039;&amp;#039;&amp;#039; şi &amp;#039;&amp;#039;&amp;#039;20&amp;#039;&amp;#039;&amp;#039; au număr maxim de divizori, dar &amp;#039;&amp;#039;&amp;#039;12&amp;#039;&amp;#039;&amp;#039; este cel mai mic.&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
def validare_date(numar):&lt;br /&gt;
    flag = False&lt;br /&gt;
    if numar.isdigit():&lt;br /&gt;
        if 0 &amp;lt;= int(numar) &amp;lt;= 100_000:&lt;br /&gt;
            flag = True&lt;br /&gt;
    return flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def nr_div_max(n):&lt;br /&gt;
    div_max = 0&lt;br /&gt;
    numar_max = 0&lt;br /&gt;
    for numar in range(1, n + 1):&lt;br /&gt;
        divizori = 0&lt;br /&gt;
        for i in range(1, numar + 1):&lt;br /&gt;
            if numar % i == 0:&lt;br /&gt;
                divizori += 1&lt;br /&gt;
        if divizori &amp;gt; div_max:&lt;br /&gt;
            div_max = divizori&lt;br /&gt;
            numar_max = numar&lt;br /&gt;
    print(numar_max)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    numar = input()&lt;br /&gt;
    if validare_date(numar):&lt;br /&gt;
        print(&amp;quot;\nDatele de intrare corespund restricțiilor impuse.\n&amp;quot;)&lt;br /&gt;
        nr_div_max(int(numar))&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Robert Manc</name></author>
	</entry>
</feed>