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

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

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