Home > Back-end >  From the keyboard to read an integer n (n <=100), the request of number 1 ~ n the number of each
From the keyboard to read an integer n (n <=100), the request of number 1 ~ n the number of each

Time:04-19

Question B: o factor number
[proposition: 201311020139]
Time limit: 1.000 SEC memory limit: 128 MB

Title description
From the keyboard to read an integer n (n<=100), the request of number 1 ~ n the number of each factor (factor number, does not contain 1 and themselves, such as a factor of 10 only 2), each row of a printed,
Enter
An integer n
O
N rows, each row an integer represents the factor of every integer number
The sample input Copy
10
Sample output Copy
0
0
0
1
0
2
0
2
1
2

CodePudding user response:

Anyone who can answer, small white I would be grateful,

CodePudding user response:

Reference:
 # include 

Int fac_cnt (int n) {
Int a=2, CNT=0;
While (a & lt;=n/2) {
If (a==0 n %)
cnt++;
a++;
}
Return CNT.
}


Int main ()
{
Int n, I=1;
The scanf (" % d ", & amp; N);
While (i<=n) {
Printf (" % d \ n ", fac_cnt (I));
i++;
}

return 0;
}
  • Related