arrow_forward
همه ارسالها
جزئیات ارسال کد#588
برای پسندیدن وارد شوید
1#include <iostream>
2using namespace std;
3int main()
4{
5 int x; cin >> x;
6 int a = 2;
7 int counter = 1;
8 int c = 1;
9 int b;
10
11 while ( x > c*c )
12 {
13 if ( c*c == x )
14 {
15 b = c;
16 break;
17 }
18
19 else if ( c*c != x )
20 {
21 c ++;
22 }
23 }
24
25 if ( c*c > x )
26 {
27 b = c*c;
28 }
29
30 while ( a <= b )
31 {
32 if ( x % a == 0 )
33 {
34 x = x / a;
35 counter ++;
36 }
37
38 else
39 {
40 a ++;
41 }
42 }
43
44 cout << counter;
45
46 return 0;
47}
کد ارسالشده برای داوری خودکار هاتکدز
UTF-8