Count in factors: Difference between revisions

C++: to_string
(add task to arm assembly raspberry pi)
(C++: to_string)
Line 984:
 
=={{header|C++}}==
<lang Cppcpp>#include <iostream>
#include <iostream>
#include <sstream>
#include <iomanip>
using namespace std;
Line 993 ⟶ 991:
{
int f = 2; string res;
if ( li == 1 ) res = "1";
else
{
while ( true )
{
if( !( li % f ) )
{
res += ss.strto_string(f);
stringstream ss; ss << f;
res += ss.str();
li /= f; if( li == 1 ) break;
res += " x ";
Line 1,013 ⟶ 1,010:
int main( int argc, char* argv[] )
{
for ( int x = 1; x < 101; x++ )
{
cout << right << setw( 4 ) << x << ": ";
Line 1,021 ⟶ 1,018:
cout << "\n\n";
return system( "pause" );
}</lang>
}
</lang>
{{out}}
<pre>
Anonymous user