<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Сколько раз в числе встречается единица]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15171&amp;type=atom" />
	<updated>2020-03-07T13:34:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15171</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=138375#p138375" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>With New RegExp
	.Pattern = &quot;1&quot;
	.Global = True
	MsgBox .Execute(&quot;543344111&quot;).Count
End With</code></pre></div><p>Докину ещё вариант.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2020-03-07T13:34:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=138375#p138375</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137812#p137812" />
			<content type="html"><![CDATA[<p><strong>kamar</strong><br /><span style="color: red">Второе предупреждение по оформлению темы. Ознакомьтесь с Правилами публикации. Не сможете понять о чем я говорю, то попрощаемся.</span></p><p>Темы объединил.</p>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2020-02-12T17:32:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137812#p137812</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137811#p137811" />
			<content type="html"><![CDATA[<p><strong>kamar</strong></p><p>Ответили ведь уже в предыдущей теме. <br />JSman <a href="http://forum.script-coding.com/viewtopic.php?id=15171">http://forum.script-coding.com/viewtopic.php?id=15171</a><br />Самое краткое и эффективное решение - через функцию Replace(), а далее она сама <em>оптимизированным компилированным двоичным</em> кодом решает.<br /></p><div class="codebox"><pre><code>
	num = 1010111
	tmp = CStr(num)
	res = len(tmp) - len(replace(tmp, &quot;1&quot;, &quot;&quot;))
	MsgBox res
</code></pre></div><p>Через циклы Do While - ну, если сразу и не проверяя, ...</p><div class="codebox"><pre><code>
	num = 1010111
	tmp = CStr(num)
	res = 0
	i = 1
	Do While i &lt;= Len(tmp)
		If Mid(tmp, i, 1) = &quot;1&quot; Then
			res = res + 1
		End If
		i = i + 1
	Loop
	MsgBox res
</code></pre></div><p>PS. Название &quot;новой&quot; темы, конечно, 5+. Выпилит модератор, как пить дать. Аминь. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[andypetr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40320</uri>
			</author>
			<updated>2020-02-11T15:15:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137811#p137811</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137810#p137810" />
			<content type="html"><![CDATA[<p><strong>kamar</strong>, я твой препод по информатике, не пытайся меня обмануть, решай сам!!!</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-11T13:32:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137810#p137810</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137784#p137784" />
			<content type="html"><![CDATA[<p><strong>kamar</strong><br />А вы взяли себе за труд прочитать хотябы это <a href="http://script-coding.com/wsh_chm.zip">http://script-coding.com/wsh_chm.zip</a>?</p>]]></content>
			<author>
				<name><![CDATA[Vladimir]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27154</uri>
			</author>
			<updated>2020-02-10T20:07:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137784#p137784</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137783#p137783" />
			<content type="html"><![CDATA[<p><strong>JSman</strong><br />Можете объяснить значения строк?</p>]]></content>
			<author>
				<name><![CDATA[kamar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40618</uri>
			</author>
			<updated>2020-02-10T17:52:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137783#p137783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137716#p137716" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>num = 1010111
tmp = CStr(num)
res = len(tmp) - len(replace(tmp, &quot;1&quot;, &quot;&quot;))

MsgBox res</code></pre></div>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2020-02-08T05:44:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137716#p137716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: Сколько раз в числе встречается единица]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137709#p137709" />
			<content type="html"><![CDATA[<p>Дано целое число. Найти сколько раз в его десятичной записи встречается единица.</p>]]></content>
			<author>
				<name><![CDATA[kamar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40618</uri>
			</author>
			<updated>2020-02-07T18:55:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137709#p137709</id>
		</entry>
</feed>
