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

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

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