<?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=0994_-_Fibo_Verif_1</id>
	<title>0994 - Fibo Verif 1 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=0994_-_Fibo_Verif_1"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0994_-_Fibo_Verif_1&amp;action=history"/>
	<updated>2026-05-01T14:32:18Z</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=0994_-_Fibo_Verif_1&amp;diff=7571&amp;oldid=prev</id>
		<title>Miawinator at 12:58, 3 December 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0994_-_Fibo_Verif_1&amp;diff=7571&amp;oldid=prev"/>
		<updated>2023-12-03T12:58:09Z</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 12:58, 3 December 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-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&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 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;= Date de intrare =&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;Pe prima linie a fişierului &amp;lt;code&amp;gt;fiboverif1.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in&lt;/del&gt;&amp;lt;/code&amp;gt; se află numărul &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;, iar pe a doua linie &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; numere naturale.&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;Pe prima linie a fişierului &amp;lt;code&amp;gt;fiboverif1.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;txt&lt;/ins&gt;&amp;lt;/code&amp;gt; se află numărul &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;, iar pe a doua linie &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; numere naturale.&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;= 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;Pe prima linie a fişierului &amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fiboverif1&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;out&lt;/del&gt;&amp;lt;/code&amp;gt; se vor afla elementele şirului dat care sunt termeni ai şirului lui Fibonacci, separaţi prin exact un spaţiu.&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;Pe prima linie a fişierului &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fiboverif2&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;txt&lt;/ins&gt;&amp;lt;/code&amp;gt; se vor afla elementele şirului dat care sunt termeni ai şirului lui Fibonacci, separaţi prin exact un spaţiu.&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>Miawinator</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=0994_-_Fibo_Verif_1&amp;diff=7569&amp;oldid=prev</id>
		<title>Miawinator: Pagină nouă: = Cerinţa = Se consideră şirul Fibonacci, definit astfel: &lt;code&gt;f1=1&lt;/code&gt;, &lt;code&gt;f2=1&lt;/code&gt;, respectiv &lt;code&gt;fn=fn-1+fn-2&lt;/code&gt;, dacă &lt;code&gt;n&gt;2&lt;/code&gt;.  Se dă un şir cu &lt;code&gt;n&lt;/code&gt; elemente, numere naturale. Să se afişeze elementele şirului care sunt termeni ai şirului lui Fibonacci.  Se va defini şi apela o funcţie &lt;code&gt;fibo&lt;/code&gt; care verifică dacă un număr natural, transmis ca parametru, face parte din şirul lui Fibonacci.  = Date de intrare = Pe p...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=0994_-_Fibo_Verif_1&amp;diff=7569&amp;oldid=prev"/>
		<updated>2023-12-03T12:50:06Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: = Cerinţa = Se consideră şirul Fibonacci, definit astfel: &amp;lt;code&amp;gt;f1=1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;f2=1&amp;lt;/code&amp;gt;, respectiv &amp;lt;code&amp;gt;fn=fn-1+fn-2&amp;lt;/code&amp;gt;, dacă &amp;lt;code&amp;gt;n&amp;gt;2&amp;lt;/code&amp;gt;.  Se dă un şir cu &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; elemente, numere naturale. Să se afişeze elementele şirului care sunt termeni ai şirului lui Fibonacci.  Se va defini şi apela o funcţie &amp;lt;code&amp;gt;fibo&amp;lt;/code&amp;gt; care verifică dacă un număr natural, transmis ca parametru, face parte din şirul lui Fibonacci.  = Date de intrare = Pe p...&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 consideră şirul Fibonacci, definit astfel: &amp;lt;code&amp;gt;f1=1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;f2=1&amp;lt;/code&amp;gt;, respectiv &amp;lt;code&amp;gt;fn=fn-1+fn-2&amp;lt;/code&amp;gt;, dacă &amp;lt;code&amp;gt;n&amp;gt;2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Se dă un şir cu &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; elemente, numere naturale. Să se afişeze elementele şirului care sunt termeni ai şirului lui Fibonacci.&lt;br /&gt;
&lt;br /&gt;
Se va defini şi apela o funcţie &amp;lt;code&amp;gt;fibo&amp;lt;/code&amp;gt; care verifică dacă un număr natural, transmis ca parametru, face parte din şirul lui Fibonacci.&lt;br /&gt;
&lt;br /&gt;
= Date de intrare =&lt;br /&gt;
Pe prima linie a fişierului &amp;lt;code&amp;gt;fiboverif1.in&amp;lt;/code&amp;gt; se află numărul &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;, iar pe a doua linie &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; numere naturale.&lt;br /&gt;
&lt;br /&gt;
= Date de ieşire =&lt;br /&gt;
Pe prima linie a fişierului &amp;lt;code&amp;gt;fiboverif1.out&amp;lt;/code&amp;gt; se vor afla elementele şirului dat care sunt termeni ai şirului lui Fibonacci, separaţi prin exact un spaţiu.&lt;br /&gt;
&lt;br /&gt;
= Restricţii şi precizări =&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;1 ≤ n ≤ 10&amp;lt;/code&amp;gt;&lt;br /&gt;
* elementele şirului vor avea cel mult &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt; cifre&lt;br /&gt;
&lt;br /&gt;
== Exemplul 1 ==&lt;br /&gt;
fiboverif1.txt:&lt;br /&gt;
&lt;br /&gt;
8&lt;br /&gt;
&lt;br /&gt;
13 1 8 24 21 55 47 8&lt;br /&gt;
&lt;br /&gt;
fiboverif2.txt:&lt;br /&gt;
&lt;br /&gt;
13 1 8 21 55 8&lt;br /&gt;
&lt;br /&gt;
== Exemplul 2 ==&lt;br /&gt;
fiboverif1.txt:&lt;br /&gt;
&lt;br /&gt;
0&lt;br /&gt;
&lt;br /&gt;
13 1 8 24 21 55 47 8 9&lt;br /&gt;
&lt;br /&gt;
Output consola: Numărul n trebuie să fie între 1 și 10.&lt;br /&gt;
&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
def validate_input(n, sir):&lt;br /&gt;
    # Verificare pentru n&lt;br /&gt;
    if not (1 &amp;lt;= n &amp;lt;= 10):&lt;br /&gt;
        print(&amp;quot;Numărul n trebuie să fie între 1 și 10.&amp;quot;)&lt;br /&gt;
        return False&lt;br /&gt;
&lt;br /&gt;
    # Verificare pentru fiecare element din șir&lt;br /&gt;
    for x in sir:&lt;br /&gt;
        if not (1 &amp;lt;= x &amp;lt;= 999999999):&lt;br /&gt;
            print(&amp;quot;Elementele șirului trebuie să fie numere naturale cu cel mult 9 cifre.&amp;quot;)&lt;br /&gt;
            return False&lt;br /&gt;
&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
def fibo(numar):&lt;br /&gt;
    a, b = 0, 1&lt;br /&gt;
    while a &amp;lt;= numar:&lt;br /&gt;
        if a == numar:&lt;br /&gt;
            return True&lt;br /&gt;
        a, b = b, a + b&lt;br /&gt;
    return False&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    # Citire date de intrare din fisier&lt;br /&gt;
    with open(&amp;quot;fiboverif1.txt&amp;quot;, &amp;quot;r&amp;quot;) as f:&lt;br /&gt;
        n = int(f.readline())&lt;br /&gt;
        sir = list(map(int, f.readline().split()))&lt;br /&gt;
&lt;br /&gt;
    # Verificare validitate input&lt;br /&gt;
    if not validate_input(n, sir):&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Afișare elemente din șir care sunt termeni ai șirului lui Fibonacci&lt;br /&gt;
    rezultat = [str(x) for x in sir if fibo(x)]&lt;br /&gt;
&lt;br /&gt;
    # Scriere rezultat in fisier&lt;br /&gt;
    with open(&amp;quot;fiboverif2.txt&amp;quot;, &amp;quot;w&amp;quot;) as f:&lt;br /&gt;
        f.write(&amp;quot; &amp;quot;.join(rezultat))&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Miawinator</name></author>
	</entry>
</feed>