<?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=1258_-_scadere2</id>
	<title>1258 - scadere2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1258_-_scadere2"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1258_-_scadere2&amp;action=history"/>
	<updated>2026-05-01T04:05:36Z</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=1258_-_scadere2&amp;diff=151&amp;oldid=prev</id>
		<title>Bogdan.Pop at 22:00, 23 December 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1258_-_scadere2&amp;diff=151&amp;oldid=prev"/>
		<updated>2022-12-23T22:00:37Z</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 22:00, 23 December 2022&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-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&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;== 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;== Rezolvare ==  &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;=== Rezolvare ver. 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;=== Rezolvare ver. 1 ===&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;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;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;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;python&quot; line&lt;/ins&gt;&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;def validare_date(numar1, numar2):&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;def validare_date(numar1, numar2):&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;     flag = False&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;     flag = False&lt;/div&gt;&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;         print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&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;         print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&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;div&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;      &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;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;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;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bogdan.Pop</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1258_-_scadere2&amp;diff=132&amp;oldid=prev</id>
		<title>Bogdan.Pop: Created page with &quot;== Cerința == Se dau două numere naturale &#039;&#039;&#039;numar1&#039;&#039;&#039;, &#039;&#039;&#039;numar2&#039;&#039;&#039;. Calculați diferenţa lor. == Date de intrare == Programul citește de la tastatură 2 numere naturale, &#039;&#039;&#039;numar1&#039;&#039;&#039; și &#039;&#039;&#039;numar2&#039;&#039;&#039;. == Date de ieșire == În cazul în care datele de intrare nu corespund restricțiilor impuse se va afișa mesajul &quot;Datele de intrare nu corespund restricțiilor impuse.&quot;. În caz contrar, se va afișa mesajul &quot;Datele de intrare corespund restricțiilor impuse.&quot;, pe u...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1258_-_scadere2&amp;diff=132&amp;oldid=prev"/>
		<updated>2022-12-23T21:25:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Cerința == Se dau două numere naturale &amp;#039;&amp;#039;&amp;#039;numar1&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;numar2&amp;#039;&amp;#039;&amp;#039;. Calculați diferenţa lor. == Date de intrare == Programul citește de la tastatură 2 numere naturale, &amp;#039;&amp;#039;&amp;#039;numar1&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;numar2&amp;#039;&amp;#039;&amp;#039;. == Date de ieșire == În cazul în care datele de intrare nu corespund restricțiilor impuse se va afișa mesajul &amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;. În caz contrar, se va afișa mesajul &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot;, pe u...&amp;quot;&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ă numere naturale &amp;#039;&amp;#039;&amp;#039;numar1&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;numar2&amp;#039;&amp;#039;&amp;#039;. Calculați diferenţa lor.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Programul citește de la tastatură 2 numere naturale, &amp;#039;&amp;#039;&amp;#039;numar1&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;numar2&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
== Date de ieșire ==&lt;br /&gt;
În cazul în care datele de intrare nu corespund restricțiilor impuse se va afișa mesajul &amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;.&lt;br /&gt;
În caz contrar, se va afișa mesajul &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot;, pe următorul rând afișându-se diferența celor două numere.&lt;br /&gt;
== Restricții și precizări ==&lt;br /&gt;
* numar1, numar2 &amp;amp;isin; &amp;amp;Nu;&lt;br /&gt;
* 0 &amp;amp;les; numar1, numar2 &amp;amp;les; &amp;amp;Nu;&lt;br /&gt;
* se va scădea din primul număr cel de-al doilea&lt;br /&gt;
== Exemplu == &lt;br /&gt;
; Intrare&lt;br /&gt;
: 5&lt;br /&gt;
: 3&lt;br /&gt;
; Ieșire&lt;br /&gt;
: 2&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
; Intrare&lt;br /&gt;
: 5.2&lt;br /&gt;
: -20&lt;br /&gt;
; Ieșire&lt;br /&gt;
: Datele introduse nu corespund restricțiilor impuse.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
; Intrare&lt;br /&gt;
: asd&lt;br /&gt;
: 10_000_000_000&lt;br /&gt;
; Ieșire&lt;br /&gt;
: Datele introduse nu corespund restricțiilor impuse.&lt;br /&gt;
== Rezolvare == &lt;br /&gt;
=== Rezolvare ver. 1 ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
def validare_date(numar1, numar2):&lt;br /&gt;
    flag = False&lt;br /&gt;
    &lt;br /&gt;
    # cu ajutorul metodei .isdigit(), care returnează valoarea True dacă șirul de caractere dat este format doar din cifre (0 - 9), determinăm dacă datele de intrare sunt numere sau nu&lt;br /&gt;
    if numar1.isdigit() and numar2.isdigit():&lt;br /&gt;
        # cu ajutorul funcției len(), care returnează lungimea unui șir de caractere sub formă de număr întreg, determinăm dacă cele 2 numere se află sau nu în intervalul dorit&lt;br /&gt;
        if 0 &amp;lt; len(numar1) &amp;lt; 10 and 0 &amp;lt; len(numar2) &amp;lt; 10:&lt;br /&gt;
            flag = True&lt;br /&gt;
&lt;br /&gt;
    return flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def scadere2(numar1, numar2):&lt;br /&gt;
    diferenta = numar1 - numar2&lt;br /&gt;
    &lt;br /&gt;
    print(diferenta)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    numar1 = input()&lt;br /&gt;
    numar2 = input()&lt;br /&gt;
    &lt;br /&gt;
    if validare_date(numar1, numar2):&lt;br /&gt;
        numar1, numar2 = int(numar1), int(numar2)&lt;br /&gt;
        &lt;br /&gt;
        print(&amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
        scadere2(numar1, numar2)&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;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bogdan.Pop</name></author>
	</entry>
</feed>