<?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=1359_-_Ecuatie_2</id>
	<title>1359 - Ecuatie 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=1359_-_Ecuatie_2"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;action=history"/>
	<updated>2026-05-01T08:49:39Z</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=1359_-_Ecuatie_2&amp;diff=7242&amp;oldid=prev</id>
		<title>Zmicala Narcis at 16:06, 11 November 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7242&amp;oldid=prev"/>
		<updated>2023-11-11T16:06:44Z</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 16:06, 11 November 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-l73&quot;&gt;Line 73:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 73:&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;         if not (caracter.isdigit() or caracter in [&amp;#039;+&amp;#039;, &amp;#039;-&amp;#039;, &amp;#039;*&amp;#039;, &amp;#039;:&amp;#039;, &amp;#039;x&amp;#039;, &amp;#039;=&amp;#039;]):&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;         if not (caracter.isdigit() or caracter in [&amp;#039;+&amp;#039;, &amp;#039;-&amp;#039;, &amp;#039;*&amp;#039;, &amp;#039;:&amp;#039;, &amp;#039;x&amp;#039;, &amp;#039;=&amp;#039;]):&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;             raise ValueError&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;             raise ValueError&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;    # extract a and b from the equation&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;    parts = ecuatie1.split(&#039;=&#039;)&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;    a = int(&#039;&#039;.join(filter(str.isdigit, parts[0])))&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;    b = int(&#039;&#039;.join(filter(str.isdigit, parts[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;    # check if a and b are within the given range&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;    if not (1 &amp;lt;= a &amp;lt;= 30000 and 1 &amp;lt;= b &amp;lt;= 30000):&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;        raise ValueError&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;     file_out.write(&amp;quot;Datele de intrare corespund restrictiilor impuse\n&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;     file_out.write(&amp;quot;Datele de intrare corespund restrictiilor impuse\n&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zmicala Narcis</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7229&amp;oldid=prev</id>
		<title>Zmicala Narcis at 20:44, 10 November 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7229&amp;oldid=prev"/>
		<updated>2023-11-10T20:44:05Z</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 20:44, 10 November 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-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&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;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&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 lang=&amp;quot;python&amp;quot; line&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;# 1359 - Ecuatie 2&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;def validare(ecuatie1):           # functia de validare a datelor de 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;def validare(ecuatie1):           # functia de validare a datelor de 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;div&gt;     if len(ecuatie1) &amp;gt; 1000:&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;     if len(ecuatie1) &amp;gt; 1000:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zmicala Narcis</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7228&amp;oldid=prev</id>
		<title>Zmicala Narcis at 20:43, 10 November 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7228&amp;oldid=prev"/>
		<updated>2023-11-10T20:43:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;//wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;amp;diff=7228&amp;amp;oldid=7086&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Zmicala Narcis</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7086&amp;oldid=prev</id>
		<title>Zmicala Narcis: Pagină nouă: == Cerinţa == Fie &#039;&#039;&#039;a&#039;&#039;&#039; și &#039;&#039;&#039;b&#039;&#039;&#039; două numere naturale nenule. Cu ajutorul lor se pot forma ecuațiile matematice de tipul:  1) &#039;&#039;&#039;a+x=b&#039;&#039;&#039;  2) &#039;&#039;&#039;x+a=b&#039;&#039;&#039;  3) &#039;&#039;&#039;a-x=b&#039;&#039;&#039;  4) &#039;&#039;&#039;x-a=b&#039;&#039;&#039;  5) &#039;&#039;&#039;a*x=b&#039;&#039;&#039;  (unde &#039;&#039;&#039;a&#039;&#039;&#039; divide &#039;&#039;&#039;b&#039;&#039;&#039;)  6) &#039;&#039;&#039;x*a=b&#039;&#039;&#039;  (unde &#039;&#039;&#039;a&#039;&#039;&#039; divide &#039;&#039;&#039;b&#039;&#039;&#039;)  7) &#039;&#039;&#039;a:x=b&#039;&#039;&#039;  (unde &#039;&#039;&#039;b&#039;&#039;&#039; divide &#039;&#039;&#039;a&#039;&#039;&#039;)  8) &#039;&#039;&#039;x:a=b&#039;&#039;&#039;  Scrieți un program care să citească din fișierul &#039;&#039;&#039;ecuatie.in&#039;&#039;&#039; o ecuaţie de tipul precizat în enunț şi care să...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=1359_-_Ecuatie_2&amp;diff=7086&amp;oldid=prev"/>
		<updated>2023-10-30T15:13:44Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Cerinţa == Fie &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; două numere naturale nenule. Cu ajutorul lor se pot forma ecuațiile matematice de tipul:  1) &amp;#039;&amp;#039;&amp;#039;a+x=b&amp;#039;&amp;#039;&amp;#039;  2) &amp;#039;&amp;#039;&amp;#039;x+a=b&amp;#039;&amp;#039;&amp;#039;  3) &amp;#039;&amp;#039;&amp;#039;a-x=b&amp;#039;&amp;#039;&amp;#039;  4) &amp;#039;&amp;#039;&amp;#039;x-a=b&amp;#039;&amp;#039;&amp;#039;  5) &amp;#039;&amp;#039;&amp;#039;a*x=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039;)  6) &amp;#039;&amp;#039;&amp;#039;x*a=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039;)  7) &amp;#039;&amp;#039;&amp;#039;a:x=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039;)  8) &amp;#039;&amp;#039;&amp;#039;x:a=b&amp;#039;&amp;#039;&amp;#039;  Scrieți un program care să citească din fișierul &amp;#039;&amp;#039;&amp;#039;ecuatie.in&amp;#039;&amp;#039;&amp;#039; o ecuaţie de tipul precizat în enunț şi care să...&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;
Fie &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; două numere naturale nenule. Cu ajutorul lor se pot forma ecuațiile matematice de tipul:&lt;br /&gt;
&lt;br /&gt;
1) &amp;#039;&amp;#039;&amp;#039;a+x=b&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
2) &amp;#039;&amp;#039;&amp;#039;x+a=b&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
3) &amp;#039;&amp;#039;&amp;#039;a-x=b&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
4) &amp;#039;&amp;#039;&amp;#039;x-a=b&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
5) &amp;#039;&amp;#039;&amp;#039;a*x=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
6) &amp;#039;&amp;#039;&amp;#039;x*a=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
7) &amp;#039;&amp;#039;&amp;#039;a:x=b&amp;#039;&amp;#039;&amp;#039;  (unde &amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039; divide &amp;#039;&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
8) &amp;#039;&amp;#039;&amp;#039;x:a=b&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Scrieți un program care să citească din fișierul &amp;#039;&amp;#039;&amp;#039;ecuatie.in&amp;#039;&amp;#039;&amp;#039; o ecuaţie de tipul precizat în enunț şi care să determine:&lt;br /&gt;
&lt;br /&gt;
a) tipul ecuației citite;&lt;br /&gt;
b) soluția ecuației obținută prin rezolvarea acestei ecuații.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Fişierul &amp;#039;&amp;#039;&amp;#039;ecuatie2.in&amp;#039;&amp;#039;&amp;#039; conţine pe prima linie ecuația, ca în exemplu.&lt;br /&gt;
== Date de ieşire ==&lt;br /&gt;
Fişierul de ieşire &amp;#039;&amp;#039;&amp;#039;ecuatie2.out&amp;#039;&amp;#039;&amp;#039; va conține pe prima linie un număr natural reprezentând tipul ecuaţiei, iar pe a doua linie, un număr natural reprezentând soluția ecuației.&lt;br /&gt;
== Restricții și precizări ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;1 ≤ a ≤ 30 000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;1 ≤ b ≤ 30 000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Fișierul de intrare conține o singură ecuație; soluția ecuației este un număr natural.&lt;br /&gt;
== Exemplul 1 ==&lt;br /&gt;
; ecuatie2.in&lt;br /&gt;
: 23+x=100&lt;br /&gt;
; ecuatie2.out&lt;br /&gt;
: 1&lt;br /&gt;
: 77&lt;br /&gt;
== Exemplul 2 ==&lt;br /&gt;
; ecuatie2.in&lt;br /&gt;
: x*20=1400&lt;br /&gt;
; ecuatie2.out&lt;br /&gt;
: 6&lt;br /&gt;
: 70&lt;br /&gt;
== Exemplul 3 ==&lt;br /&gt;
; ecuatie2.in&lt;br /&gt;
: 15:x=3&lt;br /&gt;
; ecuatie2.out&lt;br /&gt;
: 7&lt;br /&gt;
: 5&lt;br /&gt;
== Explicații ==&lt;br /&gt;
Pentru primul exemplu, ecuația este de tipul &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;. Soluția ecuaţiei &amp;#039;&amp;#039;&amp;#039;23+x=100&amp;#039;&amp;#039;&amp;#039; este &amp;#039;&amp;#039;&amp;#039;x=77&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Pentru al doilea exemplu, ecuația este de tipul &amp;#039;&amp;#039;&amp;#039;6&amp;#039;&amp;#039;&amp;#039;. Soluția ecuaţiei &amp;#039;&amp;#039;&amp;#039;x*20=1400&amp;#039;&amp;#039;&amp;#039; este &amp;#039;&amp;#039;&amp;#039;x=70&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Pentru al treilea exemplu, ecuația este de tipul &amp;#039;&amp;#039;&amp;#039;7&amp;#039;&amp;#039;&amp;#039;. Soluția ecuaţiei &amp;#039;&amp;#039;&amp;#039;15:x=3&amp;#039;&amp;#039;&amp;#039; este &amp;#039;&amp;#039;&amp;#039;x=5&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;
def solve_equation(equation):&lt;br /&gt;
    if &amp;quot;+x=&amp;quot; in equation:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;+x=&amp;quot;))&lt;br /&gt;
        return (1, b - a)&lt;br /&gt;
    elif &amp;quot;x+&amp;quot; in equation:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;x+&amp;quot;))&lt;br /&gt;
        return (2, b - a)&lt;br /&gt;
    elif &amp;quot;-x=&amp;quot; in equation:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;-x=&amp;quot;))&lt;br /&gt;
        return (3, a - b)&lt;br /&gt;
    elif &amp;quot;x-&amp;quot; in equation:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;x-&amp;quot;))&lt;br /&gt;
        return (4, a + b)&lt;br /&gt;
    elif &amp;quot;*x=&amp;quot; in equation and int(equation.split(&amp;quot;*x=&amp;quot;)[1]) % int(equation.split(&amp;quot;*x=&amp;quot;)[0]) == 0:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;*x=&amp;quot;))&lt;br /&gt;
        return (5, b // a)&lt;br /&gt;
    elif &amp;quot;x*&amp;quot; in equation:&lt;br /&gt;
        _, temp = equation.split(&amp;quot;x*&amp;quot;)&lt;br /&gt;
        a, b = map(int, temp.split(&amp;quot;=&amp;quot;))&lt;br /&gt;
        return (6, b // a)&lt;br /&gt;
    elif &amp;quot;:x=&amp;quot; in equation and int(equation.split(&amp;quot;:x=&amp;quot;)[0]) % int(equation.split(&amp;quot;:x=&amp;quot;)[1]) == 0:&lt;br /&gt;
        a, b = map(int, equation.split(&amp;quot;:x=&amp;quot;))&lt;br /&gt;
        return (7, a // b)&lt;br /&gt;
    elif &amp;quot;x:&amp;quot; in equation:&lt;br /&gt;
        _, temp = equation.split(&amp;quot;x:&amp;quot;)&lt;br /&gt;
        a, b = map(int, temp.split(&amp;quot;=&amp;quot;))&lt;br /&gt;
        return (8, a // b)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    with open(&amp;#039;ecuatie2.in&amp;#039;, &amp;#039;r&amp;#039;) as f:&lt;br /&gt;
        equation = f.readline().strip()&lt;br /&gt;
&lt;br /&gt;
    type_of_equation, solution = solve_equation(equation)&lt;br /&gt;
&lt;br /&gt;
    with open(&amp;#039;ecuatie2.out&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;br /&gt;
        f.write(str(type_of_equation) + &amp;#039;\n&amp;#039;)&lt;br /&gt;
        f.write(str(solution) + &amp;#039;\n&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmicala Narcis</name></author>
	</entry>
</feed>