<?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=1303_-_Calculator</id>
	<title>1303 - Calculator - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1303_-_Calculator"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;action=history"/>
	<updated>2026-05-01T14:21:23Z</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=1303_-_Calculator&amp;diff=4121&amp;oldid=prev</id>
		<title>Vardai Erwin: /* Date de ieșire */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;diff=4121&amp;oldid=prev"/>
		<updated>2023-04-22T18:05:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Date de ieșire&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 18:05, 22 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-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&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;==Date de 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;==Date de 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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Programul &lt;/del&gt;va afișa pe ecran numărul &#039;&#039;&#039;R&#039;&#039;&#039;, reprezentând rezultatul operației.&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;Dacă datele sunt introduse corect, pe ecran se va afișa: &quot;Datele de intrare corespund restricțiilor impuse.&quot; și programul &lt;/ins&gt;va afișa pe ecran numărul &#039;&#039;&#039;R&#039;&#039;&#039;, reprezentând rezultatul operației. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;În caz contrar, se va afișa pe ecran: &quot;Datele de intrare nu corespund restricțiilor impuse.&quot;&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;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;==Restricții și precizări==&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;==Restricții și precizări==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Vardai Erwin</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;diff=4029&amp;oldid=prev</id>
		<title>Vardai Erwin: /* Exemplul 1 */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;diff=4029&amp;oldid=prev"/>
		<updated>2023-04-22T15:05:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemplul 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 15:05, 22 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-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&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;&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;:10 20&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;:10  &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;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;:+&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;&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;;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; &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;:Datele de intrare corespund restricțiilor impuse.&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;:30&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;:30&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;/table&gt;</summary>
		<author><name>Vardai Erwin</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;diff=3701&amp;oldid=prev</id>
		<title>Tuca Liviu Razvan: Pagină nouă: ==Cerință== Se dau &#039;&#039;&#039;două numere naturale&#039;&#039;&#039; și un simbol pentru una dintre operațiile &#039;&#039;&#039;+, -, *, /&#039;&#039;&#039; (adunare, scădere, înmulțire, impărțire). Să se determine rezultatul operației aplicate pentru cele două numere.  ==Date de intrare== Programul citește de la tastatură numerele &#039;&#039;&#039;A B&#039;&#039;&#039;, iar apoi &#039;&#039;&#039;simbolul operației&#039;&#039;&#039;.  ==Date de ieșire== Programul va afișa pe ecran numărul &#039;&#039;&#039;R&#039;&#039;&#039;, reprezentând rezultatul operației.  ==Restricții și precizări==...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1303_-_Calculator&amp;diff=3701&amp;oldid=prev"/>
		<updated>2023-04-15T17:01:31Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Cerință== Se dau &amp;#039;&amp;#039;&amp;#039;două numere naturale&amp;#039;&amp;#039;&amp;#039; și un simbol pentru una dintre operațiile &amp;#039;&amp;#039;&amp;#039;+, -, *, /&amp;#039;&amp;#039;&amp;#039; (adunare, scădere, înmulțire, impărțire). Să se determine rezultatul operației aplicate pentru cele două numere.  ==Date de intrare== Programul citește de la tastatură numerele &amp;#039;&amp;#039;&amp;#039;A B&amp;#039;&amp;#039;&amp;#039;, iar apoi &amp;#039;&amp;#039;&amp;#039;simbolul operației&amp;#039;&amp;#039;&amp;#039;.  ==Date de ieșire== Programul va afișa pe ecran numărul &amp;#039;&amp;#039;&amp;#039;R&amp;#039;&amp;#039;&amp;#039;, reprezentând rezultatul operației.  ==Restricții și precizări==...&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 dau &amp;#039;&amp;#039;&amp;#039;două numere naturale&amp;#039;&amp;#039;&amp;#039; și un simbol pentru una dintre operațiile &amp;#039;&amp;#039;&amp;#039;+, -, *, /&amp;#039;&amp;#039;&amp;#039; (adunare, scădere, înmulțire, impărțire). Să se determine rezultatul operației aplicate pentru cele două numere.&lt;br /&gt;
&lt;br /&gt;
==Date de intrare==&lt;br /&gt;
Programul citește de la tastatură numerele &amp;#039;&amp;#039;&amp;#039;A B&amp;#039;&amp;#039;&amp;#039;, iar apoi &amp;#039;&amp;#039;&amp;#039;simbolul operației&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==Date de ieșire==&lt;br /&gt;
Programul va afișa pe ecran numărul &amp;#039;&amp;#039;&amp;#039;R&amp;#039;&amp;#039;&amp;#039;, reprezentând rezultatul operației.&lt;br /&gt;
&lt;br /&gt;
==Restricții și precizări==&lt;br /&gt;
*atât numerele date cât și rezultatul operației au &amp;#039;&amp;#039;&amp;#039;cel mult 9 cifre&amp;#039;&amp;#039;&amp;#039;;&lt;br /&gt;
*numerele &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039; nu sunt neapărat în ordine crescătoare sau descrescătoare; pentru operațiile de scădere și împărțire primul operand va fi numărul mai mare;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039; reprezintă determinarea câtului împărțirii întregi.&lt;br /&gt;
&lt;br /&gt;
==Exemplul 1==&lt;br /&gt;
;Intrare&lt;br /&gt;
&lt;br /&gt;
:10 20&lt;br /&gt;
:+&lt;br /&gt;
&lt;br /&gt;
;Ieșire&lt;br /&gt;
&lt;br /&gt;
:30&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(a, b):&lt;br /&gt;
    if len(str(a)) &amp;gt; 9 or len(str(b)) &amp;gt; 9:&lt;br /&gt;
        print(&amp;quot;Numerele trebuie să aibă cel mult 9 cifre!&amp;quot;)&lt;br /&gt;
        return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def calculeaza(a, b, operatie):&lt;br /&gt;
    if operatie == &amp;#039;+&amp;#039;:&lt;br /&gt;
        r = a + b&lt;br /&gt;
    elif operatie == &amp;#039;-&amp;#039;:&lt;br /&gt;
        if b &amp;gt; a:&lt;br /&gt;
            r = b - a&lt;br /&gt;
        else:&lt;br /&gt;
            r = a - b&lt;br /&gt;
    elif operatie == &amp;#039;*&amp;#039;:&lt;br /&gt;
        r = a * b&lt;br /&gt;
    elif operatie == &amp;#039;/&amp;#039;:&lt;br /&gt;
        if a &amp;gt; b:&lt;br /&gt;
            if b != 0:&lt;br /&gt;
                r = a / b&lt;br /&gt;
            else:&lt;br /&gt;
                print(&amp;quot;Impartirea la zero nu este permisa!&amp;quot;)&lt;br /&gt;
        else:&lt;br /&gt;
            if a != 0:&lt;br /&gt;
                r = b / a&lt;br /&gt;
            else:&lt;br /&gt;
                print(&amp;quot;Impartirea la zero nu este permisa!&amp;quot;)&lt;br /&gt;
            return None&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Operatie invalida!&amp;quot;)&lt;br /&gt;
        return None&lt;br /&gt;
    return r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    a = int(input(&amp;quot;Introdu primul numar: &amp;quot;))&lt;br /&gt;
    b = int(input(&amp;quot;Introdu al doilea numar: &amp;quot;))&lt;br /&gt;
    operatie = input(&amp;quot;Introdu operatia (+, -, *, /): &amp;quot;)&lt;br /&gt;
    if validare(a, b):&lt;br /&gt;
        print(&amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
        print(calculeaza(a, b, operatie))&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explicatie==&lt;br /&gt;
&lt;br /&gt;
Programul este scris în Python și conține două funcții, &amp;#039;&amp;#039;&amp;#039;validare(a, b)&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;calculeaza(a, b, operatie)&amp;#039;&amp;#039;&amp;#039;, care verifică dacă numerele introduse și simbolul de operație sunt valide și calculează rezultatul operației respective. Funcția &amp;#039;&amp;#039;&amp;#039;validare(a, b)&amp;#039;&amp;#039;&amp;#039; verifică dacă ambele numere au cel mult 9 cifre, iar funcția &amp;#039;&amp;#039;&amp;#039;calculeaza(a, b, operatie)&amp;#039;&amp;#039;&amp;#039; efectuează operația specificată și returnează rezultatul.&lt;br /&gt;
&lt;br /&gt;
În funcția &amp;#039;&amp;#039;&amp;#039;calculeaza(a, b, operatie)&amp;#039;&amp;#039;&amp;#039;, mai întâi se verifică simbolul de operație pentru a determina operația specificată. Apoi, se efectuează operația specificată pe numerele a și b și se stochează rezultatul în variabila &amp;#039;&amp;#039;&amp;#039;r&amp;#039;&amp;#039;&amp;#039;. În cazul în care simbolul de operație este &amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039;, se verifică mai întâi dacă primul operand este mai mare decât al doilea, în caz contrar se inversează numerele. De asemenea, se verifică și dacă divisorul este zero, caz în care se afișează o eroare.&lt;br /&gt;
&lt;br /&gt;
În funcția &amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;, utilizatorul este întâi solicitat să introducă cele două numere și simbolul de operație. Apoi, se verifică dacă datele de intrare sunt valide utilizând funcția &amp;#039;&amp;#039;&amp;#039;validare(a, b)&amp;#039;&amp;#039;&amp;#039;. În caz afirmativ, se afișează un mesaj de confirmare și se calculează rezultatul utilizând funcția &amp;#039;&amp;#039;&amp;#039;calculeaza(a, b, operatie)&amp;#039;&amp;#039;&amp;#039;. În caz contrar, se afișează un mesaj de eroare.&lt;br /&gt;
&lt;br /&gt;
În plus, sunt incluse și câteva instrucțiuni de control a fluxului (if/else) și utilizarea parametrului special &amp;#039;&amp;#039;&amp;#039;__name__&amp;#039;&amp;#039;&amp;#039; pentru a verifica dacă programul este rulat direct sau importat ca modul.&lt;br /&gt;
&lt;br /&gt;
Pentru a face codul mai ușor de citit și de înțeles, sunt incluse și câteva comentarii. Acestea încep cu semnul &amp;#039;&amp;#039;&amp;#039;#&amp;#039;&amp;#039;&amp;#039; și sunt ignorate de către interpretorul Python la rulare. Comentariile explică modul în care funcțiile sunt utilizate și detalii despre ceea ce face fiecare funcție.&lt;/div&gt;</summary>
		<author><name>Tuca Liviu Razvan</name></author>
	</entry>
</feed>