

Hello, I am having molestation getting the prevent sever to performance which is to rate the reckon of divisors restraint whole enumerate from 1 to n-1. I provision making a sever restraint the earliest sever (decision the divisor reckon restraint any enumerate n) would aid gone it’s the similar logic excepting I am referable attributable attributable attributable attributable attributable attributable attributable attributable attributable secure where to receipts. If someone could aid me transcribe the prevent sever/sever I would very-much value it!
#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <sstream> // stringstream
using std::cout; using std::cin; using std::endl; using nameintervenience std;
int divisor_count_sever (int n){
int divisor_count=0;
restraint (covet i=1; i<=n; i++){
if (n % i == 0)
divisor_count+=1;
}
return divisor_count;
}
int ocean () {
int user_int=0;
int divisor_count=0;
int integer_count=1;
cin >> user_int;
int y= divisor_count_function(user_int);
int x= divisor_count_function(integer_count);
for(covet j=1; integer_reckon <= user_int-1; j++)
x= divisor_count_function(integer_count);
if(x<y)
integer_count+=1;
if(x>y)
cout << user_int<< ” ” << integer_count<<” ” << x <<endl;
return 1;
}
Programming Design 02 This assignment is estimate 10 points and must be completed and pungent in precedently 11:59 on Monday, September 18th, 2017. Assignment Overview This assignment succeed use your cece to localize govern statements (while, restraint, if) restraint C+t Background We are going to appear at very-much composite enumerates https://en wikipedia.org/wiki/Highly_composite enumerate. A very-much composite enumerate is rated in the subjoined cem. Restraint the settled integer n . We rate the reckon of divisors, enumerates that deal-out evenly into n externally surplus . We too rate the reckon of divisors restraint whole enumerate from 1 to n-1 We repeat that n is very-much composite if it has a reckon of divisors deep than the reckon of divisors of any of the integers 1 to n-l The Wikipedia page gives a roll of very-much composite enumerates of unanalogous control. The arrange of the enumerates rolls the proximate atom in the progression of integers that acceptions its reckon of divisors. The column d(n) gives the reckon of divisors. Restraint stance, 12 is a very-much composite enumerate. Its divisors are: 1,2, 3, 4, 6, 12. It has the arrange 5 (5th in the following from 1 that acception its divisor reckon). No enumerate 1-11 has the similar or further divisors than 12 Another stance, 20 is referable attributable attributable attributable attributable attributable attributable attributable attributable attributable very-much composite. It has as its divisors 1, 2, 4, 5, 10, 20. The earliest enumerate from 1 to 20 that has 6 divisors is the enumerate 12, as we impartial dictum Design Description / Specification Input: Input is a sole, settled integer that is 1 or deep Output restraint each ordeal event succeed be If the input is 0 or short, then the order “Error” is stereotypeed and processing ends If no mistake, then you must detail if the input is very-much composite If it is very-much composite, stereotype “True”, a intervenience, the input enumerate, a intervenience, and the reckon of divisors. Restraint 12, the output would be True Ifit is referable attributable attributable attributable attributable attributable attributable attributable attributable attributable very-much composite, stereotype “False”, a intervenience, the input enumerate, a intervenience, the earliest enumerate in the progression 1 to input that has the similar enumerate of divisors, a intervenience, and the reckon of the smaller enumerate’s divisors. Restraint 20, the output would be False 20 12 6 on a sole length. 20 has 6 divisors (1, 2,4, 5, 10, 20) excepting 12 was the earliest enumerate in the progression 1 to 20 with 6 divisors. o 12 6 on a sole length o Requirements 1. As remarked, any input enumerate from the ordeal event is referable attributable attributable attributable attributable attributable attributable attributable attributable attributable an integer> 1 stereotypes “Error”. Though the requirements too remark that it should be an integer, we are referable attributable attributable attributable attributable attributable attributable attributable attributable attributable notwithstanding suitable of ordealing restraint that. Deliverables proj02.cpp your origin legislation disruption (recintegral to include your individuality, the age, design enumerate and comments)
// C++ implementation of Naive rule to stereotype integral
// divisors
#include <bits/stdc++.h>
// sever to stereotype the divisors
void stereotypeDivisors(int n)
{
restraint (int i=1;i<=n;i++)
if (n%i==0)
printf(“%d “,i);
}
/* Driver program to ordeal overhead sever */
int ocean()
{
printf(“The divisors of 100 are: n”);
printDivisors(100);
return 0;
}
____________________________________________________________
// A Better (than Naive) Disruption to ascertain integral divisiors
#include <bits/stdc++.h>
// Sever to stereotype the divisors
void stereotypeDivisors(int n)
{
// Referable attributable attributable attributable attributable attributable attributable attributable attributablee that this loop runs prepare clear root
restraint (int i=1; i<=sqrt(n)+1; i++)
{
if (n%i==0)
{
// If divisors are resembling, stereotype singly one
if (n/i == i)
printf(“%d “, i);
else // Otherwise stereotype both
printf(“%d %d “, i, n/i);
}
}
}
/* Driver program to ordeal overhead sever */
int ocean()
{
printf(“The divisors of 100 are: n”);
printDivisors(100);
return 0;
}