<?xml version="1.0" encoding="iso-8859-2"?>
<rss version="2.0">
<channel>
<title>Nazwa forum</title>
<link>http://www.easypro.pun.pl</link>
<description> Nazwa forum</description>
<language>pl</language>
<docs>http://backend.userland.com/rss</docs>
<item>
<title>program mikrofala i opis(ENG)</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=16#p16</link>
<guid isPermaLink="false">16@http://www.easypro.pun.pl</guid>
<description><![CDATA[<a href="http://chsm.sourceforge.net/examples/microwave/" target="_blank" rel="nofollow">http://chsm.sourceforge.net/examples/microwave/</a>]]></description>
<pubDate>PiÅ¡tek 11 StyczeÅ„</pubDate>
<comments>PiÅ¡tek 11 StyczeÅ„</comments>
</item>
<item>
<title>Program z klass(SPR)</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=15#p15</link>
<guid isPermaLink="false">15@http://www.easypro.pun.pl</guid>
<description><![CDATA[//---------------------------------------------------------------------------<br />#include &lt;vcl\condefs.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;conio.h&gt;<br />#include &lt;iostream.h&gt;<br />#include &lt;math.h&gt;<br />#pragma hdrstop<br />//---------------------------------------------------------------------------<br />class bryla{<br />protected:<br />&nbsp; float r;<br />&nbsp; float p;<br />&nbsp; float f;<br />&nbsp; virtual float pole(float p) {return 0;};<br />&nbsp; virtual float objetosc(float f) {return 0;};<br />public:<br /> void Wypisz();<br /> float PPodst(float x) {return 0;};<br /> };<br /> void bryla::Wypisz(){<br /> cout&lt;&lt;&quot;Objetos wynosi: \n&quot;;<br /> cout&lt;&lt;objetosc(f);<br /> cout&lt;&lt;&quot;\n&quot;;<br /> cout&lt;&lt;&quot;pole wynosi: \n&quot;;<br /> cout&lt;&lt;pole(p);<br /> }<br /> //-------------------------------------------<br />class walec:public bryla{<br /> protected:<br />&nbsp; &nbsp;float h;<br />&nbsp; &nbsp;float pole(float p);<br />&nbsp; &nbsp;float objetosc(float f);<br /> public:<br />&nbsp; void Podaj();<br />&nbsp; };<br />&nbsp; void walec::Podaj()<br />&nbsp; {<br />&nbsp; cout&lt;&lt;&quot; podaj r &quot;;<br />&nbsp; cin&gt;&gt;r;<br /> cout&lt;&lt;&quot; podaj h &quot;;<br />&nbsp; cin&gt;&gt;h;<br />};<br />float walec::objetosc(float f){<br />return (3.14*(r*r)*h);<br />}<br />float walec::pole(float p){<br />return ((2*3.14*r*(r+h))*(3.14*(r*r)));<br />}<br />//---------------------------------------------------<br />class kula:public bryla{<br /> protected:<br />&nbsp; &nbsp;float pole(float p);<br />&nbsp; &nbsp;float objetosc(float f);<br /> public:<br />&nbsp; void Podaj();<br />&nbsp; };<br />&nbsp; void kula::Podaj()<br />&nbsp; {<br />&nbsp; cout&lt;&lt;&quot; podaj r &quot;;<br />&nbsp; cin&gt;&gt;r;<br />};<br />float kula::objetosc(float f){<br />return (4*(3.14*(r*r*r))/3);<br />}<br />float kula::pole(float p){<br />return (4*3.14*(r*r));<br />}<br />//----------------------------------------------------<br />class stozek:public bryla{<br /> protected:<br />&nbsp; &nbsp;float l;<br />&nbsp; &nbsp;float h;<br />&nbsp; &nbsp;float pole(float p);<br />&nbsp; &nbsp;float objetosc(float f);<br /> public:<br />&nbsp; void Podaj();<br />&nbsp; };<br />&nbsp; void stozek::Podaj()<br />&nbsp; {<br />&nbsp; cout&lt;&lt;&quot; podaj r &quot;;<br />&nbsp; cin&gt;&gt;r;<br /> cout&lt;&lt;&quot; podaj h &quot;;<br />&nbsp; cin&gt;&gt;h;<br />};<br /><br />float stozek::objetosc(float f){<br />return ((3.14*(r*r)*h)/3);<br />}<br />float stozek::pole(float p){<br />l=sqrt(r*r+h*h);<br />return (3.14*r*(r+l));<br />}<br />//---------------------------------------------------------------------------<br />main()<br />{<br />int a;<br /> cout &lt;&lt;&quot;1-walec \n&quot;;<br /> cout &lt;&lt;&quot;2-stozek \n&quot;;<br /> cout &lt;&lt;&quot;3-kula \n&quot;;<br /> cout &lt;&lt;&quot;K-Koniec \n&quot;;<br /> cout &lt;&lt;&quot;__________________________________________\n&quot;;<br /> cin&gt;&gt;a;<br />&nbsp; &nbsp; switch (a)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; case 1:<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; walec*c=new walec;<br />&nbsp; &nbsp; c-&gt;Podaj();<br />&nbsp; &nbsp; c-&gt;Wypisz();<br />&nbsp; &nbsp; break;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; case 2:<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; stozek*c=new stozek;<br />&nbsp; &nbsp; c-&gt;Podaj();<br />&nbsp; &nbsp; c-&gt;Wypisz();<br />&nbsp; &nbsp; break;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp;case 3:<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; kula*c=new kula;<br />&nbsp; &nbsp; c-&gt;Podaj();<br />&nbsp; &nbsp; c-&gt;Wypisz();<br />&nbsp; &nbsp; break;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; default: cout &lt;&lt;&quot;Koniec \n&quot;; break;<br />&nbsp; &nbsp; }<br />&nbsp; getch();<br />}<br />//---------------------------------------------------------------------------]]></description>
<pubDate>PiÅ¡tek 7 GrudzieÅ„</pubDate>
<comments>PiÅ¡tek 7 GrudzieÅ„</comments>
</item>
<item>
<title>ad 3 poprawiona</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=14#p14</link>
<guid isPermaLink="false">14@http://www.easypro.pun.pl</guid>
<description><![CDATA[Operacje wej¶cia-wyj¶cia to podstawowe operacje tzw. komunikacji strumieniowej. Nale¿± do tego g³ównie operacje na plikach i strumieniach standardowych. <br /><br />iosfwd i ios z definicjami pierwotnymi <br />streambuf, istream, ostream i iostream, podstawowe klasy operuj±ce abstrakcyjnym &quot;io&quot; (plus strumienie standardowe) <br />iomanip, manipulatory strumieni <br />fstream, klasy operacji na plikach <br />sstream, klasy operacji na strumieniach tekstowych <br />cstdio, operacje &quot;io&quot; zgodne z bibliotek± standardow± C]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>ad3</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=13#p13</link>
<guid isPermaLink="false">13@http://www.easypro.pun.pl</guid>
<description><![CDATA[Ad3.<br />ifstream &#8211; tylko do odczytu zapisu w pliku;<br />ofstream &#8211; tylko do zapisu pilku;<br />fstream &#8211;mo¿na jednoczesnie zapisywac i odczytyac dane z pliku;<br />int a;<br />char bufor[256];<br />...<br />ifstream plik; //do odczytu<br />plik.open(&quot;test.txt&quot;);<br />...<br />plik &gt;&gt; a; //wczytanie z pliku zmiennej typu int<br />plik &gt;&gt; bufor; //wczytanie ³añcucha znaków<br />...<br />plik.close();]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>ad1</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=12#p12</link>
<guid isPermaLink="false">12@http://www.easypro.pun.pl</guid>
<description><![CDATA[#include &lt;iostream.h&gt;<br />#include &lt;conio.h&gt;<br />#include &lt;math.h&gt;<br /><br />int main()<br />{<br />double a, b, c,suma,x,y;<br />double delta;<br />&nbsp; cout &lt;&lt; &quot;Rownanie kwadratowe o wzorze : ax^2+bx+c=0&quot;;<br />&nbsp; cout &lt;&lt; endl &lt;&lt; endl;<br />&nbsp; cout &lt;&lt; &quot;Podaj wartosc a: &quot;;<br />&nbsp; cin &gt;&gt; a;<br />&nbsp; cout &lt;&lt; &quot;Podaj wartosc b: &quot;;<br />&nbsp; cin &gt;&gt; b;<br />&nbsp; cout &lt;&lt; &quot;Podaj wartosc c: &quot;;<br />&nbsp; cin &gt;&gt; c;<br />&nbsp; cout &lt;&lt; endl;<br />if (a==0)<br />cout&lt;&lt;&quot;brak rownania kwadratowego!\n&quot;;<br />else<br />{<br />delta=b*b-4*a*c;<br />if (delta&gt;0)<br />{<br />cout&lt;&lt;&quot;Istnieja dwa pierwiastki wynoszace \n&quot;;<br />cout&lt;&lt;&quot;x1 = &quot; &lt;&lt; (-b+sqrt(delta))/(2*a) &lt;&lt; endl;<br />cout&lt;&lt;&quot;x2 = &quot; &lt;&lt; (-b-sqrt(delta))/(2*a) &lt;&lt; endl;<br />suma=(-b+sqrt(delta))/(2*a)+(-b-sqrt(delta))/(2*a);<br />cout&lt;&lt;&quot; suma miejsc zerowych wynosi: &quot;&lt;&lt;suma;<br />}<br /><br />else<br />if (delta==0)<br />{<br />cout &lt;&lt;&quot;Istnieje jeden pierwiastek = &quot;&lt;&lt;-b/(2*a)&lt;&lt;endl;<br />suma=(-b+sqrt(delta))/(2*a)+(-b-sqrt(delta))/(2*a);<br />cout&lt;&lt;&quot; suma miejsc zerowych wynosi: &quot;&lt;&lt;suma;<br />}<br />else<br />cout&lt;&lt;&quot;BRAK PIERWIASTKOW\n&quot;;<br />{<br />x=(-1*b)/2*a;<br />y=(-1*delta)/4*a;<br />cout&lt;&lt;&quot; \n wierzcholek paraboli to: &quot;&lt;&lt;x&lt;&lt;&quot; , &quot;&lt;&lt;y&lt;&lt;endl;<br />}<br />}<br />cout &lt;&lt; endl;<br />cout&lt;&lt;&quot; &quot;;<br />getch();<br />return 0;<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>ad1</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=11#p11</link>
<guid isPermaLink="false">11@http://www.easypro.pun.pl</guid>
<description><![CDATA[#include &lt;iostream.h&gt;<br />#include &lt;conio.h&gt;<br />#include &lt;math.h&gt;<br /><br />int main()<br />{<br />double a, b, c,suma,xw,yw;<br />double delta;<br />cout &lt;&lt; &quot;Rownanie kwadratowe o wzorze : ax^2 + bx + c = 0&quot;;<br />&nbsp; &nbsp; cout &lt;&lt; endl &lt;&lt; endl;<br />&nbsp; &nbsp; cout &lt;&lt; &quot;Podaj wspolczynnik a: &quot;;<br />&nbsp; &nbsp; cin &gt;&gt; a;<br />cout &lt;&lt; &quot;Podaj wspolczynnik b: &quot;;<br />cin &gt;&gt; b;<br />cout &lt;&lt; &quot;Podaj wspolczynnik c: &quot;;<br />cin &gt;&gt; c;<br />cout &lt;&lt; endl;<br />if (a == 0)<br />cout &lt;&lt; &quot;brak rownania kwadratowego!\n&quot;;<br />else<br />{<br />delta = b*b - 4*a*c;<br />if (delta &lt; 0)<br />cout &lt;&lt; &quot;Rownanie kwadratowe nie ma pierwiastkow!\n&quot;;<br />else<br />if (delta == 0)<br />cout &lt;&lt; &quot;Rownanie kwadratowe ma jeden pierwiastek: x = &quot; &lt;&lt; -b/(2*a) &lt;&lt; endl;<br />else<br />{<br />cout &lt;&lt; &quot;Rownanie ma dwa pierwiastki:\n&quot;;<br />cout &lt;&lt; &quot;x1 = &quot; &lt;&lt; (-b+sqrt(delta))/(2*a) &lt;&lt; endl;<br />cout &lt;&lt; &quot;x2 = &quot; &lt;&lt; (-b-sqrt(delta))/(2*a) &lt;&lt; endl;<br />}<br />{<br />suma=(-b+sqrt(delta))/(2*a)+(-b-sqrt(delta))/(2*a);<br />cout&lt;&lt;&quot; suma miejsc zerowych wynosi: &quot;&lt;&lt;suma;<br />}<br />{<br />xw=(-1*b)/2*a;<br />yw=(-1*delta)/4*a;<br /><br />cout&lt;&lt;&quot; \n wierzcholek paraboli to: &quot;&lt;&lt;xw&lt;&lt;&quot; , &quot;&lt;&lt;yw&lt;&lt;endl;<br /><br />}<br />}<br />cout &lt;&lt; endl;<br />cout&lt;&lt;&quot; Autor projektu Marcin Jessa kl.IIIi &quot;;<br /><br />getch();<br />return 0;<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>zad 2</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=10#p10</link>
<guid isPermaLink="false">10@http://www.easypro.pun.pl</guid>
<description><![CDATA[#include&lt;iostream.h&gt;<br />#include&lt;conio.h&gt;<br />#include&lt;math.h&gt;<br />#include&lt;stdio.h&gt;<br />#include&lt;time.h&gt;<br />#include&lt;stdlib.h&gt;<br /><br /><br />main()<br />{<br />&nbsp; int i,j;<br />&nbsp; int tab[10];<br />&nbsp; int tmp;<br />&nbsp; bool change;<br />&nbsp; randomize();<br />&nbsp; for (i=0; i&lt;10; i++)<br />&nbsp; { tab[i]=random(50);<br />&nbsp; cout&lt;&lt;tab[i]&lt;&lt;endl;<br />&nbsp; }<br />&nbsp; cout&lt;&lt;&quot;\n&quot;;<br />&nbsp; cout&lt;&lt;&quot;Liczby posortowane malejaco: \n&quot;;<br />&nbsp; for (i=0; i&lt;10; i++)<br />&nbsp; {<br /><br />&nbsp; &nbsp; &nbsp; for (j=0; j&lt;9-i; j++)<br />&nbsp; &nbsp; &nbsp; if (tab[j+1] &gt; tab[j])<br />&nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tmp = tab[j];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tab[j] = tab[j+1];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tab[j+1] = tmp;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; }<br />&nbsp; for (i=0; i&lt;10; i++)<br />&nbsp; cout&lt;&lt;tab[i]&lt;&lt;endl;<br />&nbsp; getch();<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>Przykladowe algorytmy cz.2</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=9#p9</link>
<guid isPermaLink="false">9@http://www.easypro.pun.pl</guid>
<description><![CDATA[//---------------------------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp; PLIK<br />#include &lt;vcl\condefs.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;iostream.h&gt;<br />#include &lt;fstream.h&gt;<br />#include &lt;string&gt;<br />#pragma hdrstop<br />//---------------------------------------------------------------------------<br />USERES(&quot;zad1.res&quot;);<br />//---------------------------------------------------------------------------<br />int main()<br />{<br />char dane[255];<br />cout&lt;&lt;&quot;Podaj cos: &quot;;<br />cin.get(dane,255);<br />ofstream plik(&quot;tekst.txt&quot;);<br />if (plik){<br />plik&lt;&lt;dane;<br />plik.close();<br />}<br />ifstream plik2(&quot;tekst.txt&quot;);<br />if (plik2){<br />plik2.get(dane,255);<br />plik2.close();<br />}<br />cout&lt;&lt;&quot;Zawartosc pliku: &quot;&lt;&lt;dane&lt;&lt;endl;<br />cin.get();<br />cin.get();<br />return 0;<br />}<br />//---------------------------------------------------------------------------<br /><br /><br />SILNIA I NEWTON<br /><br />//---------------------------------------------------------------------------<br /><br />#include &lt;vcl.h&gt;<br />#include &lt;iostream.h&gt;<br />#pragma hdrstop<br /><br />//---------------------------------------------------------------------------<br /><br />#pragma argsused<br />int silnia_n(int n);<br />int silnia_k(int k);<br />double newton(int k,int n);<br />int main()<br />{<br />cout&lt;&lt;&quot;Podaj n: &quot;;<br />int n;<br />cin&gt;&gt;n;<br />if(n&gt;0)cout&lt;&lt;&quot;Silnia n to: &quot;&lt;&lt;silnia_n(n);<br />else cout&lt;&lt;&quot;Niewlasciwe dane!&quot;;<br />cout&lt;&lt;endl&lt;&lt;&quot;Podaj k: &quot;;<br />int k;<br />cin&gt;&gt;k;<br />if(k&gt;0)cout&lt;&lt;&quot;Silnia k to: &quot;&lt;&lt;silnia_k(k);<br />else cout&lt;&lt;&quot;Niewlasciwe dane!&quot;;<br />cout&lt;&lt;endl;<br />if((k&gt;0)&&(n&gt;0)&&(n-k&gt;0))cout&lt;&lt;&quot;Symbol Newtona wynosi : &quot;&lt;&lt;newton(k,n);<br />else cout&lt;&lt;&quot;Niewlasciwe dane!&quot;;<br />cin.get();<br />cin.get();<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />}<br />int silnia_n(int n)<br />{<br />int s=1;<br />for(int i=1;i&lt;n+1;i++)<br />s*=i;<br />return s;<br />}<br />int silnia_k(int k)<br />{<br />int s=1;<br />for(int i=1;i&lt;k+1;i++)<br />s*=i;<br />return s;<br />}<br />double newton(int k,int n)<br />{<br />int s=1,s2=1;<br />double w;<br />for(int i=n-k+1;i&lt;n+1;i++)s*=i;<br />for(int i=1;i&lt;k+1;i++)s2*=i;<br />w=s/s2;<br />return w;<br />}<br />//---------------------------------------------------------------------------<br /> <br />&nbsp; &nbsp; &nbsp; &nbsp; ROWNANIE KWADRATOWE<br /><br />//---------------------------------------------------------------------------<br />#include &lt;vcl\condefs.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;iostream.h&gt;<br />#include &lt;math.h&gt;<br />#pragma hdrstop<br />//---------------------------------------------------------------------------<br />USERES(&quot;Project1.res&quot;);<br />//---------------------------------------------------------------------------<br />int main()<br />{<br />float a,b,c,x0,x1,delta;<br />cout&lt;&lt;&quot;Podaj a: &quot;;<br />cin&gt;&gt;a;<br />cout&lt;&lt;&quot;Podaj b: &quot;;<br />cin&gt;&gt;b;<br />cout&lt;&lt;&quot;Podaj c: &quot;;<br />cin&gt;&gt;c;<br />delta=b*b-4*a*c;<br />if(delta&lt;0) cout&lt;&lt;&quot;Nie ma rozwiazan&quot;&lt;&lt;endl;<br />if(delta==0){ x0=(-1*b)/(2*a);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;&quot;Rozwiazaniem jest &quot;&lt;&lt;x0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />if(delta&gt;0)&nbsp; { x0=((-1*b)-sqrt(delta))/(2*a);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x1=((-1*b)+sqrt(delta))/(2*a);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout&lt;&lt;&quot;Rozwiazaniami tego rowania sa &quot;&lt;&lt;x0&lt;&lt;&quot; oraz &quot;&lt;&lt;x1&lt;&lt;endl;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />cin.get();<br />cin.get();<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />}<br />//--------------------------------------------------------------------------<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SORTOWANIE<br /><br />//---------------------------------------------------------------------------<br />#include &lt;iostream.h&gt;<br />#include &lt;vcl.h&gt;<br />#pragma hdrstop<br /><br />//---------------------------------------------------------------------------<br /><br />#pragma argsused<br />void losowanie(int T[],int n);<br />void sortowanie(int T[],int n);<br />void wyswietl(int T[],int n,int l);<br />int main()<br />{<br />int T[20];<br />int l=1;<br />losowanie(T,20);<br />wyswietl(T,20,l);<br />l++;<br />sortowanie(T,20);<br />wyswietl(T,20,l);<br />cin.get();<br />cin.get();<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />}<br /><br />void losowanie(int T[],int n)<br />{<br />bool pf;<br />int k;<br />int z;<br />cout&lt;&lt;&quot;Podaj zakres losowania: &quot;;<br />cin&gt;&gt;z;<br />for(int i=0;i&lt;n;i++){<br />&nbsp; &nbsp; &nbsp; &nbsp;pf=true;<br />&nbsp; &nbsp; &nbsp; &nbsp;while(pf)<br />&nbsp; &nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp;k=random(z);<br />&nbsp; &nbsp; &nbsp; &nbsp;for(int j=0;j&lt;n;j++)<br />&nbsp; &nbsp; &nbsp; &nbsp;if(k!=T[j])pf=false;<br />&nbsp; &nbsp; &nbsp; &nbsp;else {<br />&nbsp; &nbsp; &nbsp; &nbsp; pf=true;<br />&nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp;T[i]=k;<br />&nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />}<br />void sortowanie(int T[],int n)<br />{<br />int p;<br />for (int i=0;i&lt;n;i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(int j=i;j&lt;n;j++)if (T[i]&gt;T[j]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p=T[i];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; T[i]=T[j];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; T[j]=p;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />void wyswietl(int T[],int n,int l)<br />{<br />if(l==1)cout&lt;&lt;&quot;Elementy nieposortowane: &quot;&lt;&lt;endl;<br />else cout&lt;&lt;&quot;Elementy posortowane: &quot;&lt;&lt;endl;<br />for(int i=0;i&lt;n;i++)cout&lt;&lt;T[i]&lt;&lt;&quot; &quot;;<br />cout&lt;&lt;endl;<br />}<br />//---------------------------------------------------------------------------<br /> <br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LANCUCHY<br /><br />//---------------------------------------------------------------------------<br /><br />#include &lt;vcl.h&gt;<br />#include &lt;iostream.h&gt;<br />#pragma hdrstop<br /><br />//---------------------------------------------------------------------------<br /><br />#pragma argsused<br />int main()<br />{<br />char s[255];<br />cout&lt;&lt;&quot;Podaj lancuch: &quot;;<br />cin.get(s,255);<br />cout&lt;&lt;&quot;Dlugosc tego lancucha to: &quot;&lt;&lt;strlen(s);<br />cin.get();<br />cin.get();<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />}<br />//---------------------------------------------------------------------------<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELEMENTY<br /><br />//---------------------------------------------------------------------------<br />#include &lt;iostream.h&gt;<br />#include &lt;vcl.h&gt;<br />#pragma hdrstop<br /><br />//---------------------------------------------------------------------------<br />const int Size=8;<br />int losowanie(int T[], int n);<br />int min(int T[], int n);<br />int max(int T[], int n);<br />int wyswietl(int T[], int n, int max, int min);<br />#pragma argsused<br />int main()<br />{<br />int T[Size]={1,2,4,8,16,32,64,128};<br />int sum=losowanie(T,Size);<br />int min_z=min(T,Size);<br />int max_z=max(T,Size);<br />int wys=wyswietl(T,Size,min_z,max_z);<br />cin.get();<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />}<br />int min(int T[], int n)<br />{<br />int p=T[0];<br />for(int i=1;i&lt;n;i++)<br />&nbsp; if(p&gt;T[i]) p=T[i];<br />&nbsp; return p;<br />}<br />int max(int a[], int n)<br />{<br />int p=a[0];<br />for(int i=1;i&lt;n;i++)<br />&nbsp; if(p&lt;a[i]) p=a[i];<br />&nbsp; return p;<br />}&nbsp; <br />int losowanie(int a[], int n)<br />{<br />void Randomize();<br />srand ( time(NULL) );<br />for(int i=0;i&lt;n;i++)<br />a[i]=random(200);<br />}<br />int wyswietl(int a[], int n, int max, int min)<br />{<br />cout&lt;&lt;&quot;Wylosowane liczby to: &quot;;<br />for(int i=0;i&lt;n;i++)<br />cout&lt;&lt;a[i]&lt;&lt;&quot; &quot;;<br />cout&lt;&lt;endl;<br />cout&lt;&lt;&quot;Element minimalny to: &quot;&lt;&lt;min&lt;&lt;endl;<br />cout&lt;&lt;&quot;Element maksymalny to: &quot;&lt;&lt;max&lt;&lt;endl;<br />}&nbsp; &nbsp;<br />//---------------------------------------------------------------------------]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>krotszy zapis pliku</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=6#p6</link>
<guid isPermaLink="false">6@http://www.easypro.pun.pl</guid>
<description><![CDATA[# include &lt;vcl\condefs.h&gt;<br /># include &lt;stdio.h&gt;<br /># include &lt;stdlib.h&gt;<br /># include &lt;iostream.h&gt;<br /># include &lt;fstream.h&gt;<br /># include &lt;string.h&gt;<br />main()<br />{<br />ofstream file;<br />file.open(&quot;nan.txt&quot;)<br />file&lt;&lt;&quot;ala ma kota/n&quot;&lt;100;<br />file.close();<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>plik</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=5#p5</link>
<guid isPermaLink="false">5@http://www.easypro.pun.pl</guid>
<description><![CDATA[# include &lt;vcl\condefs.h&gt;<br /># include &lt;stdio.h&gt;<br /># include &lt;stdlib.h&gt;<br /># include &lt;iostream.h&gt;<br /># include &lt;fstream.h&gt;<br /># include &lt;string.h&gt;<br />int main()<br />{<br />char dane[255];<br />cout&lt;&lt;&quot;podaj cos &quot;;<br />cin.get(dane,255);<br />ofstream plik(&quot;tekst.txt&quot;);<br />if (plik){<br />plik&lt;&lt;dane;<br />plik.close();<br />}<br />cout&lt;&lt;&quot;zawartosc pliku: &quot;&lt;&lt;dane&lt;&lt;endl;<br />cin.get();<br />cin.get();<br />return 0;<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>sortowanie babelkowe</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=4#p4</link>
<guid isPermaLink="false">4@http://www.easypro.pun.pl</guid>
<description><![CDATA[#include&lt;iostream.h&gt;<br />#include&lt;conio.h&gt;<br />#include&lt;math.h&gt;<br />#include&lt;stdio.h&gt;<br />#include&lt;time.h&gt;<br />#include&lt;stdlib.h&gt;<br />typedef int TYP;<br /><br />main()<br />{<br />&nbsp; int i,j;<br />&nbsp; int a[20];<br />&nbsp; TYP tmp;<br />&nbsp; bool change;<br />&nbsp; randomize();<br />&nbsp; for (i=0; i&lt;20; i++)<br />&nbsp; { a[i]=rand()%20;<br />&nbsp; &nbsp; cout&lt;&lt;a[i]&lt;&lt;endl;<br />&nbsp; }<br /><br />&nbsp; for (i=0; i&lt;20; i++)<br />&nbsp; {<br />&nbsp; &nbsp; &nbsp; change=false;<br />&nbsp; &nbsp; &nbsp; for (j=0; j&lt;20-i; j++)<br />&nbsp; &nbsp; &nbsp; &nbsp; if (a[j+1] &lt; a[j])&nbsp; &nbsp;//porównanie s±si±dów<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tmp = a[j];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a[j] = a[j+1];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a[j+1] = tmp;&nbsp; &nbsp;//wypchanie b±belka<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;change=true;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; if(!change) break;&nbsp; &nbsp; &nbsp;// nie dokonano zmian - koniec!<br />&nbsp; }<br />&nbsp; cout&lt;&lt;&quot;oto ciag posortowany:&quot;&lt;&lt;endl;<br />&nbsp; for (i=0; i&lt;20; i++)<br />&nbsp; cout&lt;&lt;a[i]&lt;&lt;endl;<br />&nbsp; getch();<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
<item>
<title>Przykladowe algorytmy</title>
<link>http://www.easypro.pun.pl/viewtopic.php?pid=3#p3</link>
<guid isPermaLink="false">3@http://www.easypro.pun.pl</guid>
<description><![CDATA[Rownanie kwadratowe<br /><br />&nbsp; &nbsp; #include &lt;iostream.h&gt;<br />#include &lt;conio.h&gt;<br />#include &lt;math.h&gt;<br /><br />int main()<br />{<br />double a, b, c;<br />double delta;<br />cout &lt;&lt; &quot;Rownanie kwadratowe o wzorze : ax^2 + bx + c = 0&quot;;<br />&nbsp; &nbsp; cout &lt;&lt; endl &lt;&lt; endl;<br />&nbsp; &nbsp; cout &lt;&lt; &quot;Podaj wspolczynnik a: &quot;;<br />&nbsp; &nbsp; cin &gt;&gt; a;<br />cout &lt;&lt; &quot;Podaj wspolczynnik b: &quot;;<br />cin &gt;&gt; b;<br />cout &lt;&lt; &quot;Podaj wspolczynnik c: &quot;;<br />cin &gt;&gt; c;<br /> cout &lt;&lt; endl;<br /> if (a == 0)<br /> cout &lt;&lt; &quot;brak rownania kwadratowego!\n&quot;;<br /> else<br />{<br />delta = b*b - 4*a*c;<br />if (delta &lt; 0)<br />cout &lt;&lt; &quot;Rownanie kwadratowe nie ma pierwiastkow!\n&quot;;<br />else<br />if (delta == 0)<br />cout &lt;&lt; &quot;Rownanie kwadratowe ma jeden pierwiastek: x = &quot; &lt;&lt; -b/(2*a) &lt;&lt; endl;<br />else<br />{<br />cout &lt;&lt; &quot;Rownanie ma dwa pierwiastki:\n&quot;;<br />cout &lt;&lt; &quot;x1 = &quot; &lt;&lt; (-b+sqrt(delta))/(2*a) &lt;&lt; endl;<br />cout &lt;&lt; &quot;x2 = &quot; &lt;&lt; (-b-sqrt(delta))/(2*a) &lt;&lt; endl;<br />}<br />}<br />cout &lt;&lt; endl;<br />cout&lt;&lt;&quot; Autor projektu Marcin Jessa kl.IIIi &quot;;<br /><br />getch();<br />return 0;<br />}<br />Podajesz 10 wlasnych liczb i jest podawany elemet max i ninimalny&nbsp; &nbsp; <br /><br />#include &lt;vcl\condefs.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;conio.h&gt;<br />#include &lt;iostream.h&gt;<br /><br />#pragma hdrstop<br /><br />USERES(&quot;zero_i_max.res&quot;);<br />//---------------------------------------------------------------------------<br />int main(int argc, char **argv)<br />{<br />&nbsp; int tab[10];<br />&nbsp; int i,l,j,max,mini;<br />for (i=0;i&lt;10;i++)<br />{<br />cout&lt;&lt;&quot;Podaj liczbe &quot;;<br />cin&gt;&gt;tab[i];<br />}<br />l=0;<br />for (i=0;i&lt;10;i++)<br />if (tab[i]==0)<br />l++;<br />cout&lt;&lt;&quot;W tablicy wystepuje &quot;&lt;&lt;l&lt;&lt;&quot; zer \n&quot;;<br />max=tab[1];<br /><br />for (i=0;i&lt;10;i++)<br />for (j=i+1;j&lt;10;j++)<br />if (tab[i]&gt;max)<br />max=tab[i];<br /><br />cout&lt;&lt;&quot;Najwyzszy element tablicy wynosi &quot;&lt;&lt;max&lt;&lt;&quot;\n&quot;;<br />mini=tab[1];<br /><br />for (i=0;i&lt;10;i++)<br />for (j=i+1;j&lt;10;j++)<br />if (tab[i]&lt;mini)<br />mini=tab[i];<br />cout&lt;&lt;&quot;najmniejsza liczba w tablicy to &quot;&lt;&lt;mini;<br />getch();<br />&nbsp; &nbsp; return 0;<br />}]]></description>
<pubDate>PiÅ¡tek 19 PaÂŸdziernik</pubDate>
<comments>PiÅ¡tek 19 PaÂŸdziernik</comments>
</item>
</channel>
</rss>
