<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум компьютерной помощи &mdash; Программирование на C++. Примеры программ.]]></title>
		<link>https://itpmr.ru/viewtopic.php?id=725</link>
		<atom:link href="https://itpmr.ru/extern.php?action=feed&amp;tid=725&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Программирование на C++. Примеры программ.».]]></description>
		<lastBuildDate>Fri, 30 Nov 2012 09:15:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123672#p123672</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:15:41 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123672#p123672</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123671#p123671</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:15:32 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123671#p123671</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123670#p123670</link>
			<description><![CDATA[<p>#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;conio.h&gt;</p><br /><p>void main(void)<br />{<br />clrscr();<br />int m=0,i=0,n=0;<br />char ab;<br />FILE *p;<br />p=fopen(&quot;men.txt&quot;,&quot;r&quot;);<br />i=0;<br />n=0;<br />m=0;<br />while(!feof(p))<br />{<br /> i++;<br /> fread(&amp;ab,sizeof(char), 1, p);</p><p>//fseek(p,i,0);<br /> if(ab==&#039;&quot;&#039;)<br />&nbsp; &nbsp; n++;</p><p> if(n%2==1)<br />&nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;%c&quot;,ab);</p><p>}<br />fclose(p);<br />getch();<br />}</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:15:09 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123670#p123670</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123669#p123669</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:10:22 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123669#p123669</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123668#p123668</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:09:50 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123668#p123668</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123667#p123667</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:07:45 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123667#p123667</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123666#p123666</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:02:06 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123666#p123666</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123665#p123665</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 09:01:58 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123665#p123665</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123664#p123664</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />int sum(int i);<br />void main()<br />{<br />clrscr();<br />int i,m,n;<br />float fac=0;<br />printf(&quot;Введите первое число\n&quot;);<br />scanf(&quot;%d&quot;,&amp;m);<br />printf(&quot;Введите второе число\n&quot;);<br />scanf(&quot;%d&quot;,&amp;n);<br />for(i=m;i&lt;=n;i++)<br />&nbsp; &nbsp; if(i%2==0)<br />&nbsp; &nbsp; fac=fac+sum(i);<br />printf(&quot;Summa=%.f&quot;,fac);<br />getch();<br />}<br />int sum(int i)<br />{<br />if(i==1)<br />&nbsp; &nbsp; return(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return(sum(i-1)*i);</p><p>}</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:45:47 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123664#p123664</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123663#p123663</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />int func (int i);</p><p>void main()<br />{<br />clrscr();<br />int i,n,p,a,c=0,c1,c2;<br />printf(&quot;Введите число:\n&quot;); // вводим число, до которого считать, т.е. будем проверять все числа в промежутке от единицы до этого числа<br />scanf(&quot;%d&quot;,&amp;n);<br />for(i=1;i&lt;=n;i++)<br />{<br /> c=func(i); // перебираем все цифры в этом промежутке, передавая каждую в нашу пользовательскую функцию<br /> if(c==1)<br />&nbsp; &nbsp; printf(&quot;%d &quot;,i);<br /> c=0;<br />}</p><p>getch();<br />}</p><p>int func(int i)<br />{<br />&nbsp; int p,a,c=0,c1,c2;<br />&nbsp; &nbsp;c1=0;<br />&nbsp; &nbsp;c2=0;<br />&nbsp; &nbsp;a=i; //присваивам переменной а значение текущего числа<br />&nbsp; &nbsp;p=0;<br />&nbsp; &nbsp;while(a!=0) //вычисляем сколько цифр числа являются его делителями<br />&nbsp; &nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; p=a%10;<br />&nbsp; &nbsp; if((p==0)||(i%p==0))<br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; if (p!=0)<br />&nbsp; &nbsp; &nbsp; &nbsp; c1++;<br />&nbsp; &nbsp; a=a/10;<br />&nbsp; &nbsp;&nbsp; c2++;<br />&nbsp; &nbsp; &nbsp; &nbsp;}</p><p>&nbsp; &nbsp;<br />&nbsp; if(c1==c2) //сравниваем, если количество цифр и количество цифр-делителей, если совпадает, значит это число относится к числам, которые делятся на каждую из своих цифр<br />&nbsp; &nbsp; &nbsp;c++;</p><p>&nbsp; return c;<br />&nbsp; &nbsp; &nbsp; }</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:45:38 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123663#p123663</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123662#p123662</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />#include&lt;math.h&gt;<br />#define PI 3.14<br />float func(float,float);<br />void main()<br />{<br />clrscr();<br />&nbsp; &nbsp; int xq,xz,xa,xb,xc,yq,yz,ya,yb,yc;<br />&nbsp; &nbsp; float S_kv,S_kr,r,ab,ac,bc,p,a;<br />&nbsp; &nbsp; printf(&quot;\t\t\tЗадача по функциям\n&quot;);<br />&nbsp; &nbsp; printf(&quot;Введите координаты точек Q и Z:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%d%d%d%d&quot;,&amp;xq,&amp;yq,&amp;xz,&amp;yz);<br />&nbsp; &nbsp; printf(&quot;Введите координаты точек A, B, C:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%d%d%d%d%d%d&quot;,&amp;xa,&amp;ya,&amp;xb,&amp;yb,&amp;xc,&amp;yc);<br />&nbsp; &nbsp;&nbsp; &nbsp; S_kr=PI*pow(sqrt(((xq-xz)*(xq-xz))+((yq-yz)*(yq-yz))),2);<br />&nbsp; &nbsp;&nbsp; &nbsp; S_kv=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);<br />&nbsp; &nbsp; p=func(S_kv,S_kr);<br />&nbsp; &nbsp; printf(&quot;\nИскомая вероятность: %.4f\n&quot;,p);<br />getch();<br />}<br />float func(float S_kv, float S_kr)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; float i;<br />&nbsp; &nbsp; i=S_kv/S_kr;<br />&nbsp; &nbsp; return i;<br />&nbsp; &nbsp; }</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:45:25 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123662#p123662</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123661#p123661</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />float ckn(float n, float k);</p><br /><p>void main()<br />{<br />clrscr();<br />&nbsp; &nbsp; float k,l,r,s,c1,c2,c3,p;<br />&nbsp; &nbsp; printf(&quot;Введите количество изделий:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f&quot;,&amp;k);<br />&nbsp; &nbsp; printf(&quot;Введите количество изделий отобранных для контроля:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f&quot;,&amp;r);<br />&nbsp; &nbsp; printf(&quot;Введите количество&nbsp; дефектных изделий:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f&quot;,&amp;l);<br />&nbsp; &nbsp; printf(&quot;Введите сколько изделий могут быть дефектными:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f&quot;,&amp;s);</p><p>&nbsp; &nbsp; &nbsp; &nbsp;c1=ckn(l,s);<br />&nbsp; &nbsp; &nbsp; &nbsp;c2=ckn(k-l,r-s);<br />&nbsp; &nbsp; &nbsp; &nbsp;c3=ckn(k,r);<br />&nbsp; &nbsp; &nbsp; p=c1*c2/c3; <br />&nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;p=%f&quot;,p);<br />getch();<br />}</p><p>float ckn(float n,float k)<br />&nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp;int i;<br />&nbsp; &nbsp; &nbsp; &nbsp;float x=1,y=1,kn=1;<br />&nbsp; &nbsp; &nbsp; &nbsp;for(i=1;i&lt;=n;i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; x=x*i;<br />&nbsp; &nbsp; for(i=1;i&lt;=k;i++)<br />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; y=y*i;<br />&nbsp; &nbsp; &nbsp; &nbsp;for(i=1;i&lt;=n-k;i++)<br />&nbsp; &nbsp; &nbsp; &nbsp;kn=kn*i;<br />&nbsp; &nbsp; &nbsp; &nbsp;y=y*kn;<br />x=x/y;<br />return x;<br />&nbsp; &nbsp; &nbsp;}</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:45:16 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123661#p123661</guid>
		</item>
		<item>
			<title><![CDATA[Re: Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123660#p123660</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />float func_y(float x, float d, float e);<br />float func_x(float a,float b,float d, float e);<br />void main()<br />{<br />clrscr();<br />&nbsp; &nbsp; float a,b,c,d,e,f;<br />&nbsp; &nbsp; float x=0,y=0;<br />&nbsp; &nbsp; printf(&quot;Введите коэффициенты 1 линейного уравнения:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f%f&quot;,&amp;a,&amp;b);<br />&nbsp; &nbsp; printf(&quot;Введите коэффициенты 2 линейного уравнения:\n&quot;);<br />&nbsp; &nbsp; scanf(&quot;%f%f&quot;,&amp;d,&amp;e);<br />&nbsp; &nbsp; &nbsp; &nbsp;x=func_x(a,b,d,e);<br />&nbsp; &nbsp; &nbsp; &nbsp;y=func_y(x,d,e);<br />&nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;x=%.f y=%.f&quot;,x,y);<br />getch();<br />}<br />float func_y(float x, float d, float e)<br />&nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp;float y;<br />&nbsp; &nbsp; &nbsp; &nbsp;y=d*x+e;<br />&nbsp; &nbsp; &nbsp; &nbsp;return y;<br />&nbsp; &nbsp; &nbsp;}<br />float func_x(float a,float b,float d, float e)<br />&nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp;float x;<br />&nbsp; &nbsp; &nbsp; &nbsp;x=(e-b)/(a-d);<br />&nbsp; &nbsp; &nbsp; &nbsp;return x;<br />&nbsp; &nbsp; &nbsp;}</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:45:04 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123660#p123660</guid>
		</item>
		<item>
			<title><![CDATA[Программирование на C++. Примеры программ.]]></title>
			<link>https://itpmr.ru/viewtopic.php?pid=123659#p123659</link>
			<description><![CDATA[<p>#include&lt;stdio.h&gt;<br />#include&lt;conio.h&gt;<br />int stepen(int,int);<br />void main()<br />{<br />clrscr();<br />int a,b,k;<br />printf(&quot;Введите число и степень:\n&quot;);<br />scanf(&quot;%d%d&quot;,&amp;a,&amp;b);<br />k=stepen(a,b);<br />printf(&quot;%d&quot;,k);<br />getch();<br />}<br />int stepen(int a,int b)<br />{ int k;<br />if(b==1)<br />return a;<br />else<br />{ k=a*stepen(a,b-1);<br />return k;<br />}}</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Fri, 30 Nov 2012 08:44:56 +0000</pubDate>
			<guid>https://itpmr.ru/viewtopic.php?pid=123659#p123659</guid>
		</item>
	</channel>
</rss>
