arrow_forward همه ارسال‌ها

جزئیات ارسال کد#601

code_blocks
مسئله مربوطه: ماراتون پینگ پنگ (#16) arrow_outward
verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: C++
schedule
ارسال‌کننده و زمان:
shana (۲ سال پیش)
descriptionsolution.cpp ۳۲ خط • ۴۶۳ بایت
1#include <iostream>
2#include <math.h>
3using namespace std;
4int main()
5{
6 long long int x; cin >> x;
7 int counter = 1;
8 int a = 2;
9 int b = sqrt (x);
10 while ( a <= b )
11 {
12 if ( x % a == 0 )
13 {
14 counter ++;
15 x = x / a;
16 }
17
18 else
19 {
20 a ++;
21 }
22 }
23
24 if ( x != 1 )
25 {
26 counter ++;
27 }
28
29 cout << counter;
30
31 return 0;
32}
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8