Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/number_of_positive_divisors.cpp File Reference</title>
<title>TheAlgorithms/C++: math/number_of_positive_divisors.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -119,7 +136,9 @@ Include dependency graph for number_of_positive_divisors.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/da4/number__of__positive__divisors_8cpp__incl.svg" width="179" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
</div>
<p><a href="../../d0/da2/number__of__positive__divisors_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad89ccced8504b5116046cfa03066ffeb" id="r_ad89ccced8504b5116046cfa03066ffeb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a> (int n)</td></tr>
@@ -140,6 +159,8 @@ Finally, there are \((e_1+1) \times (e_2+1)\times\cdots\times (e_k+1)\) positive
\(\mbox{number_of_positive_divisors}(36) = (2+1) \cdot (2+1) = 9\). <br />
list of positive divisors of 36 = 1, 2, 3, 4, 6, 9, 12, 18, 36.</p>
<p>Similarly, for N = -36 the number of positive divisors remain same. </p>
<p class="definition">Definition in file <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html">number_of_positive_divisors.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&#160;</a></span>main()</h2>
@@ -156,29 +177,23 @@ list of positive divisors of 36 = 1, 2, 3, 4, 6, 9, 12, 18, 36.</p>
</table>
</div><div class="memdoc">
<p>Main function </p>
<p class="definition">Definition at line <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html#l00081">81</a> of file <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html">number_of_positive_divisors.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 81</span> {</div>
<div class="line"><span class="lineno"> 82</span> <a class="code hl_function" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordtype">int</span> n;</div>
<div class="line"><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 84</span> std::cin &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">if</span> (n == 0) {</div>
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;All non-zero numbers are divisors of 0 !&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 86</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All non-zero numbers are divisors of 0 !&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 87</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 88</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Number of positive divisors is : &quot;</span>;</div>
<div class="line"><span class="lineno"> 89</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(n) &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 88</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Number of positive divisors is : &quot;</span>;</div>
<div class="line"><span class="lineno"> 89</span> std::cout &lt;&lt; <a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(n) &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 90</span> }</div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 92</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> number_of_positive_divisors.cpp:70</div></div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_ad89ccced8504b5116046cfa03066ffeb"><div class="ttname"><a href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a></div><div class="ttdeci">int number_of_positive_divisors(int n)</div><div class="ttdef"><b>Definition</b> number_of_positive_divisors.cpp:33</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/da2/number__of__positive__divisors_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="362" height="138"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> <a href="../../d0/da2/number__of__positive__divisors_8cpp_source.html#l00070">number_of_positive_divisors.cpp:70</a></div></div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_ad89ccced8504b5116046cfa03066ffeb"><div class="ttname"><a href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a></div><div class="ttdeci">int number_of_positive_divisors(int n)</div><div class="ttdef"><b>Definition</b> <a href="../../d0/da2/number__of__positive__divisors_8cpp_source.html#l00033">number_of_positive_divisors.cpp:33</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ad89ccced8504b5116046cfa03066ffeb" name="ad89ccced8504b5116046cfa03066ffeb"></a>
@@ -202,6 +217,8 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of positive divisors of n (or 1 if n = 0) </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html#l00033">33</a> of file <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html">number_of_positive_divisors.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">if</span> (n &lt; 0) {</div>
<div class="line"><span class="lineno"> 35</span> n = -n; <span class="comment">// take the absolute value of n</span></div>
@@ -253,6 +270,8 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p>Test implementations </p>
<p class="definition">Definition at line <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html#l00070">70</a> of file <a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp_source.html">number_of_positive_divisors.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 70</span> {</div>
<div class="line"><span class="lineno"> 71</span> assert(<a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(36) == 9);</div>
<div class="line"><span class="lineno"> 72</span> assert(<a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(-36) == 9);</div>
@@ -260,12 +279,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 74</span> assert(<a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(2011) == 2); <span class="comment">// 2011 is a prime</span></div>
<div class="line"><span class="lineno"> 75</span> assert(<a class="code hl_function" href="#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(756) == 24); <span class="comment">// 756 = 2^2 * 3^3 * 7</span></div>
<div class="line"><span class="lineno"> 76</span>}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/da2/number__of__positive__divisors_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg" width="244" height="52"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->

View File

@@ -1,5 +0,0 @@
<map id="tests" name="tests">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,13,56,38"/>
<area shape="rect" id="Node000002" href="$d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" title=" " alt="" coords="104,5,238,46"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="56,23,88,23,88,28,56,28"/>
</map>

View File

@@ -1 +0,0 @@
6c7d543302b2c1a16d3ffd0a139986e8

View File

@@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: tests Pages: 1 -->
<svg width="183pt" height="39pt"
viewBox="0.00 0.00 182.50 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>tests</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37.75,-24.88 0,-24.88 0,-5.63 37.75,-5.63 37.75,-24.88"/>
<text text-anchor="middle" x="18.88" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="174.5,-30.5 73.75,-30.5 73.75,0 174.5,0 174.5,-30.5"/>
<text text-anchor="start" x="81.75" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">number_of_positive</text>
<text text-anchor="middle" x="124.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_divisors</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.86,-15.25C44.85,-15.25 53.29,-15.25 62.11,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.9,-18.75 71.9,-15.25 61.9,-11.75 61.9,-18.75"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: tests Pages: 1 -->
<svg width="183pt" height="39pt"
viewBox="0.00 0.00 182.50 38.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 34.5)">
<title>tests</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37.75,-24.88 0,-24.88 0,-5.63 37.75,-5.63 37.75,-24.88"/>
<text text-anchor="middle" x="18.88" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="174.5,-30.5 73.75,-30.5 73.75,0 174.5,0 174.5,-30.5"/>
<text text-anchor="start" x="81.75" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">number_of_positive</text>
<text text-anchor="middle" x="124.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_divisors</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.86,-15.25C44.85,-15.25 53.29,-15.25 62.11,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.9,-18.75 71.9,-15.25 61.9,-11.75 61.9,-18.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,10 +0,0 @@
<map id="main" name="main">
<area shape="rect" id="Node000001" title=" " alt="" coords="5,56,55,82"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="103,5,174,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="54,55,94,36,97,41,56,60"/>
<area shape="rect" id="Node000003" href="$d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" title=" " alt="" coords="222,74,356,114"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="55,69,206,83,206,89,55,74"/>
<area shape="rect" id="Node000004" href="$d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" title=" " alt="" coords="113,107,164,132"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="56,78,100,99,98,104,54,83"/>
<area shape="poly" id="edge4_Node000004_Node000003" title=" " alt="" coords="164,113,206,105,207,111,165,118"/>
</map>

View File

@@ -1 +0,0 @@
a72686c8fb9c1f90e9f80fa4caf94f43

View File

@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="271pt" height="103pt"
viewBox="0.00 0.00 271.25 103.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 99.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-57.25 0,-57.25 0,-38 37,-38 37,-57.25"/>
<text text-anchor="middle" x="18.5" y="-43.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-95.25 73,-95.25 73,-76 126.5,-76 126.5,-95.25"/>
<text text-anchor="middle" x="99.75" y="-81.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-56.25C46.36,-60.51 57.34,-65.77 67.53,-70.66"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.86,-73.73 76.39,-74.9 68.88,-67.42 65.86,-73.73"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="263.25,-43.88 162.5,-43.88 162.5,-13.37 263.25,-13.37 263.25,-43.88"/>
<text text-anchor="start" x="170.5" y="-30.38" font-family="Helvetica,sans-Serif" font-size="10.00">number_of_positive</text>
<text text-anchor="middle" x="212.88" y="-19.12" font-family="Helvetica,sans-Serif" font-size="10.00">_divisors</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.25,-45.87C62.82,-43.35 111.26,-38.56 150.65,-34.67"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.91,-38.16 160.51,-33.7 150.22,-31.2 150.91,-38.16"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="118.62,-19.25 80.88,-19.25 80.88,0 118.62,0 118.62,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-39C47.14,-34.37 59.28,-28.55 70.19,-23.32"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="71.7,-26.48 79.2,-19 68.67,-20.17 71.7,-26.48"/>
</a>
</g>
</g>
<!-- Node4&#45;&gt;Node3 -->
<g id="edge4_Node000004_Node000003" class="edge">
<title>Node4&#45;&gt;Node3</title>
<g id="a_edge4_Node000004_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.1,-12.76C128.07,-14.3 139.43,-16.24 151.11,-18.23"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.39,-21.66 160.83,-19.9 151.57,-14.76 150.39,-21.66"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="271pt" height="103pt"
viewBox="0.00 0.00 271.25 103.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 99.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title=" ">
<polygon fill="#999999" stroke="#666666" points="37,-57.25 0,-57.25 0,-38 37,-38 37,-57.25"/>
<text text-anchor="middle" x="18.5" y="-43.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-95.25 73,-95.25 73,-76 126.5,-76 126.5,-95.25"/>
<text text-anchor="middle" x="99.75" y="-81.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-56.25C46.36,-60.51 57.34,-65.77 67.53,-70.66"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="65.86,-73.73 76.39,-74.9 68.88,-67.42 65.86,-73.73"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="263.25,-43.88 162.5,-43.88 162.5,-13.37 263.25,-13.37 263.25,-43.88"/>
<text text-anchor="start" x="170.5" y="-30.38" font-family="Helvetica,sans-Serif" font-size="10.00">number_of_positive</text>
<text text-anchor="middle" x="212.88" y="-19.12" font-family="Helvetica,sans-Serif" font-size="10.00">_divisors</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.25,-45.87C62.82,-43.35 111.26,-38.56 150.65,-34.67"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.91,-38.16 160.51,-33.7 150.22,-31.2 150.91,-38.16"/>
</a>
</g>
</g>
<!-- Node4 -->
<g id="Node000004" class="node">
<title>Node4</title>
<g id="a_Node000004"><a xlink:href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="118.62,-19.25 80.88,-19.25 80.88,0 118.62,0 118.62,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3_Node000001_Node000004" class="edge">
<title>Node1&#45;&gt;Node4</title>
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-39C47.14,-34.37 59.28,-28.55 70.19,-23.32"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="71.7,-26.48 79.2,-19 68.67,-20.17 71.7,-26.48"/>
</a>
</g>
</g>
<!-- Node4&#45;&gt;Node3 -->
<g id="edge4_Node000004_Node000003" class="edge">
<title>Node4&#45;&gt;Node3</title>
<g id="a_edge4_Node000004_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M119.1,-12.76C128.07,-14.3 139.43,-16.24 151.11,-18.23"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="150.39,-21.66 160.83,-19.9 151.57,-14.76 150.39,-21.66"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,204 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: math/number_of_positive_divisors.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('d0/da2/number__of__positive__divisors_8cpp_source.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">number_of_positive_divisors.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d0/da2/number__of__positive__divisors_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb"> 33</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(<span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">if</span> (n &lt; 0) {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> n = -n; <span class="comment">// take the absolute value of n</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> }</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">int</span> number_of_divisors = 1;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 2; i * i &lt;= n; i++) {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// This part is doing the prime factorization.</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// Note that we cannot find a composite divisor of n unless we would</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// already previously find the corresponding prime divisor and dvided</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// n by that prime. Therefore, all the divisors found here will</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// actually be primes.</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="comment">// The loop terminates early when it is left with a number n which</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// does not have a divisor smaller or equal to sqrt(n) - that means</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// the remaining number is a prime itself.</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> prime_exponent = 0;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">while</span> (n % i == 0) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// Repeatedly divide n by the prime divisor n to compute</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="comment">// the exponent (e_i in the algorithm description).</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> prime_exponent++;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> n /= i;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> number_of_divisors *= prime_exponent + 1;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> }</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">if</span> (n &gt; 1) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// In case the remaining number n is a prime number itself</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// (essentially p_k^1) the final answer is also multiplied by (e_k+1).</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> number_of_divisors *= 2;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">return</span> number_of_divisors;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>}</div>
</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
<div class="foldopen" id="foldopen00070" data-start="{" data-end="}">
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 70</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> assert(<a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(36) == 9);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> assert(<a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(-36) == 9);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> assert(<a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(1) == 1);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> assert(<a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(2011) == 2); <span class="comment">// 2011 is a prime</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> assert(<a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(756) == 24); <span class="comment">// 756 = 2^2 * 3^3 * 7</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span>}</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="foldopen" id="foldopen00081" data-start="{" data-end="}">
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 81</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">int</span> n;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::cin &gt;&gt; n;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">if</span> (n == 0) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All non-zero numbers are divisors of 0 !&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Number of positive divisors is : &quot;</span>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::cout &lt;&lt; <a class="code hl_function" href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a>(n) &lt;&lt; std::endl;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>}</div>
</div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../d0/da2/number__of__positive__divisors_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> <a href="#l00070">number_of_positive_divisors.cpp:70</a></div></div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_ad89ccced8504b5116046cfa03066ffeb"><div class="ttname"><a href="../../d0/da2/number__of__positive__divisors_8cpp.html#ad89ccced8504b5116046cfa03066ffeb">number_of_positive_divisors</a></div><div class="ttdeci">int number_of_positive_divisors(int n)</div><div class="ttdef"><b>Definition</b> <a href="#l00033">number_of_positive_divisors.cpp:33</a></div></div>
<div class="ttc" id="anumber__of__positive__divisors_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d0/da2/number__of__positive__divisors_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00081">number_of_positive_divisors.cpp:81</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d0/da2/number__of__positive__divisors_8cpp.html">number_of_positive_divisors.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>