<?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=2312_-_GuIT</id>
	<title>2312 - GuIT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=2312_-_GuIT"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;action=history"/>
	<updated>2026-05-01T15:13:42Z</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=2312_-_GuIT&amp;diff=3439&amp;oldid=prev</id>
		<title>Paul Matei at 10:57, 11 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=3439&amp;oldid=prev"/>
		<updated>2023-04-11T10:57:43Z</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:57, 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-l61&quot;&gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&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&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&amp;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;==Explicație 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;==Explicație rezolvare==&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;Acest &lt;/del&gt;cod &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;implementează o funcție numită &quot;print_num&quot; &lt;/del&gt;care primește două &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;argumente &quot;n&quot; și &quot;k&quot;. Funcția calculează suma tuturor divizorilor primi ai lui &quot;n&quot; care sunt mai mici sau egali cu &quot;k&quot;.&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;Acesta este un &lt;/ins&gt;cod &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Python &lt;/ins&gt;care primește două &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numere&lt;/ins&gt;, verifică dacă &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;acestea sunt valide &lt;/ins&gt;și &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;apoi calculează &lt;/ins&gt;suma &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;factorilor &lt;/ins&gt;primi ai &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;primului număr &lt;/ins&gt;care &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;apar &lt;/ins&gt;de &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cel puțin a doua valoare dată&lt;/ins&gt;. Dacă &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numerele introduse &lt;/ins&gt;sunt valide, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;codul va afișa &lt;/ins&gt;suma &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;factorilor &lt;/ins&gt;primi, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;altfel va afișa &lt;/ins&gt;un mesaj de eroare.&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;/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; 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;Mai întâi, codul validează datele de intrare prin intermediul a două funcții separate, &quot;validare_date_numar&quot; și &quot;validare_date&quot;, care se asigură că &quot;n&quot; și &quot;k&quot; sunt în limitele specificate (1 &amp;lt;= n &amp;lt;= 1000000 și 1 &amp;lt;= k &amp;lt;= 1000).&lt;/del&gt;&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; 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;/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; 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;Apoi, în interiorul funcției &quot;print_num&quot;&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se inițializează o variabilă &quot;s&quot; la 0 și se stabilește o variabilă &quot;d&quot; la 2. Se utilizează un buclă while care rulează până când &quot;n&quot; devine mai mic sau egal cu 1.&lt;/del&gt;&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; 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;/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; 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;În interiorul buclei while, se &lt;/del&gt;verifică dacă &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;n&quot; este divizibil cu &quot;d&quot;. Dacă este, se împarte &quot;n&quot; la &quot;d&quot; &lt;/del&gt;și &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se adaugă &quot;d&quot; la &lt;/del&gt;suma &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;s&quot;. Se continuă acest proces până când &quot;n&quot; nu mai este divizibil cu &quot;d&quot;. Apoi, variabila &quot;d&quot; este incrementată cu 1 și se verifică dacă &quot;d&quot; la pătrat este mai mare decât &quot;n&quot;. Dacă este, se atribuie lui &quot;d&quot; valoarea &quot;n&quot;, în caz contrar, bucla continuă.&lt;/del&gt;&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; 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;/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; 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;La final, funcția returnează suma divizorilor &lt;/del&gt;primi ai &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lui &quot;n&quot; &lt;/del&gt;care &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sunt mai mici sau egali cu &quot;k&quot;.&lt;/del&gt;&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; 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;/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; 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;În blocul &quot;if __name__ == &#039;__main__&#039;&quot;, se verifică dacă datele &lt;/del&gt;de &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;intrare sunt valide folosind cele două funcții de validare și se afișează un mesaj corespunzător&lt;/del&gt;. Dacă &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;datele de intrare &lt;/del&gt;sunt valide, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se calculează &lt;/del&gt;suma &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;divizorilor &lt;/del&gt;primi &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ai lui &quot;n&quot; și se afișează rezultatul. În caz contrar&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se afișează &lt;/del&gt;un mesaj de eroare.&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;/table&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=3361&amp;oldid=prev</id>
		<title>Diana Butuza: /* Explicație rezolvare */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=3361&amp;oldid=prev"/>
		<updated>2023-04-10T09:34:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Explicație rezolvare&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 09:34, 10 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-l71&quot;&gt;Line 71:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 71:&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;La final, funcția returnează suma divizorilor primi ai lui &amp;quot;n&amp;quot; care sunt mai mici sau egali cu &amp;quot;k&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;La final, funcția returnează suma divizorilor primi ai lui &amp;quot;n&amp;quot; care sunt mai mici sau egali cu &amp;quot;k&amp;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; 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;În blocul &quot;if &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;name &lt;/del&gt;== &#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;main&lt;/del&gt;&#039;&quot;, se verifică dacă datele de intrare sunt valide folosind cele două funcții de validare și se afișează un mesaj corespunzător. Dacă datele de intrare sunt valide, se calculează suma divizorilor primi ai lui &quot;n&quot; și se afișează rezultatul. În caz contrar, se afișează un mesaj de eroare.&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;În blocul &quot;if &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__name__ &lt;/ins&gt;== &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__main__&lt;/ins&gt;&#039;&quot;, se verifică dacă datele de intrare sunt valide folosind cele două funcții de validare și se afișează un mesaj corespunzător. Dacă datele de intrare sunt valide, se calculează suma divizorilor primi ai lui &quot;n&quot; și se afișează rezultatul. În caz contrar, se afișează un mesaj de eroare.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Diana Butuza</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=2322&amp;oldid=prev</id>
		<title>Paul Matei at 17:40, 1 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=2322&amp;oldid=prev"/>
		<updated>2023-04-01T17:40:24Z</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 17:40, 1 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-l60&quot;&gt;Line 60:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 60:&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;&amp;lt;/syntaxhighlight&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&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;==Explicație rezolvare==&lt;/ins&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;Acest cod implementează o funcție numită &quot;print_num&quot; care primește două argumente &quot;n&quot; și &quot;k&quot;. Funcția calculează suma tuturor divizorilor primi ai lui &quot;n&quot; care sunt mai mici sau egali cu &quot;k&quot;.&lt;/ins&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 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;Mai întâi, codul validează datele de intrare prin intermediul a două funcții separate, &quot;validare_date_numar&quot; și &quot;validare_date&quot;, care se asigură că &quot;n&quot; și &quot;k&quot; sunt în limitele specificate (1 &amp;lt;= n &amp;lt;= 1000000 și 1 &amp;lt;= k &amp;lt;= 1000).&lt;/ins&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 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;Apoi, în interiorul funcției &quot;print_num&quot;, se inițializează o variabilă &quot;s&quot; la 0 și se stabilește o variabilă &quot;d&quot; la 2. Se utilizează un buclă while care rulează până când &quot;n&quot; devine mai mic sau egal cu 1.&lt;/ins&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 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;În interiorul buclei while, se verifică dacă &quot;n&quot; este divizibil cu &quot;d&quot;. Dacă este, se împarte &quot;n&quot; la &quot;d&quot; și se adaugă &quot;d&quot; la suma &quot;s&quot;. Se continuă acest proces până când &quot;n&quot; nu mai este divizibil cu &quot;d&quot;. Apoi, variabila &quot;d&quot; este incrementată cu 1 și se verifică dacă &quot;d&quot; la pătrat este mai mare decât &quot;n&quot;. Dacă este, se atribuie lui &quot;d&quot; valoarea &quot;n&quot;, în caz contrar, bucla continuă.&lt;/ins&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 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;La final, funcția returnează suma divizorilor primi ai lui &quot;n&quot; care sunt mai mici sau egali cu &quot;k&quot;.&lt;/ins&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 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;În blocul &quot;if name == &#039;main&#039;&quot;, se verifică dacă datele de intrare sunt valide folosind cele două funcții de validare și se afișează un mesaj corespunzător. Dacă datele de intrare sunt valide, se calculează suma divizorilor primi ai lui &quot;n&quot; și se afișează rezultatul. În caz contrar, se afișează un mesaj de eroare.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=2321&amp;oldid=prev</id>
		<title>Paul Matei: Acest cod implementează o funcție numită &quot;print_num&quot; care primește două argumente &quot;n&quot; și &quot;k&quot;. Funcția calculează suma tuturor divizorilor primi ai lui &quot;n&quot; care sunt mai mici sau egali cu &quot;k&quot;.  Mai întâi, codul validează datele de intrare prin intermediul a două funcții separate, &quot;validare_date_numar&quot; și &quot;validare_date&quot;, care se asigură că &quot;n&quot; și &quot;k&quot; sunt în limitele specificate (1 &lt;= n &lt;= 1000000 și 1 &lt;= k &lt;= 1000).  Apoi, în interiorul funcției &quot;print_num&quot;, se inițializează o variabilă &quot;s&quot; la 0</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2312_-_GuIT&amp;diff=2321&amp;oldid=prev"/>
		<updated>2023-04-01T17:33:30Z</updated>

		<summary type="html">&lt;p&gt;Acest cod implementează o funcție numită &amp;quot;print_num&amp;quot; care primește două argumente &amp;quot;n&amp;quot; și &amp;quot;k&amp;quot;. Funcția calculează suma tuturor divizorilor primi ai lui &amp;quot;n&amp;quot; care sunt mai mici sau egali cu &amp;quot;k&amp;quot;.  Mai întâi, codul validează datele de intrare prin intermediul a două funcții separate, &amp;quot;validare_date_numar&amp;quot; și &amp;quot;validare_date&amp;quot;, care se asigură că &amp;quot;n&amp;quot; și &amp;quot;k&amp;quot; sunt în limitele specificate (1 &amp;lt;= n &amp;lt;= 1000000 și 1 &amp;lt;= k &amp;lt;= 1000).  Apoi, în interiorul funcției &amp;quot;print_num&amp;quot;, se inițializează o variabilă &amp;quot;s&amp;quot; la 0&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;
Ghiţă s-a hotărât să plece de-acasă de Ignat, având nişte previziuni sumbre. Neavând bani, s-a gândit să-şi scoată un single de sezon, “guIT”. Din vânzarea lui a obţinut frumoasa sumă de &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; dolari.Pentru a câştiga un meniu vegetarian de Crăciun, trebuie să aflaţi suma numerelor prime din descompunerea lui &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;, ştiind că &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039; este produs de trei numere prime distincte.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Programul citește de la tastatură numărul &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Date de ieşire ==&lt;br /&gt;
Programul va afișa pe ecran numărul &amp;#039;&amp;#039;&amp;#039;S&amp;#039;&amp;#039;&amp;#039;, reprezentând suma celor trei numere prime din descompunerea lui &amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Restricții și precizări ==&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;1 ≤ n ≤ 10^12&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
== Exemplu ==&lt;br /&gt;
; Intrare&lt;br /&gt;
:105&lt;br /&gt;
; Ieșire&lt;br /&gt;
: 15&lt;br /&gt;
== Explicație == &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;105 = 3•5•7&amp;#039;&amp;#039;&amp;#039;, deci suma este &amp;#039;&amp;#039;&amp;#039;3+5+7=15&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import math&lt;br /&gt;
&lt;br /&gt;
def validare_date_numar(n):&lt;br /&gt;
    if 1 &amp;lt;= int(n) &amp;lt;= 1000000:&lt;br /&gt;
        return True&lt;br /&gt;
    else:&lt;br /&gt;
        return False&lt;br /&gt;
&lt;br /&gt;
def validare_date(k):&lt;br /&gt;
    if 1 &amp;lt;= int(k) &amp;lt;= 1000:&lt;br /&gt;
        return True&lt;br /&gt;
    else:&lt;br /&gt;
        return False&lt;br /&gt;
&lt;br /&gt;
def print_num(n, k):&lt;br /&gt;
    s = 0&lt;br /&gt;
    d = 2&lt;br /&gt;
&lt;br /&gt;
    while n &amp;gt; 1:&lt;br /&gt;
        p = 0&lt;br /&gt;
        while n % d == 0:&lt;br /&gt;
            n //= d&lt;br /&gt;
            p += 1&lt;br /&gt;
        if p &amp;gt; 0:&lt;br /&gt;
            s += d&lt;br /&gt;
        d += 1&lt;br /&gt;
        if d * d &amp;gt; n:&lt;br /&gt;
            d = n&lt;br /&gt;
&lt;br /&gt;
    return s&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    n = input()&lt;br /&gt;
    k = input()&lt;br /&gt;
    if validare_date_numar(n) and validare_date(k):&lt;br /&gt;
        print(&amp;quot;\nDatele de intrare corespund restricțiilor impuse.\n&amp;quot;)&lt;br /&gt;
        numar = print_num(int(n), int(k))&lt;br /&gt;
        print(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;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
</feed>