Thứ Tư, 27 tháng 4, 2022

UCNT C++

#include <bits/stdc++.h>
using namespace std;

long long m;

void giai()
{
    int d=0;
    i=2;
      while(i<=int(sqrt(n)))
    {
        if(n%i==0) d++;
        while (n%i==0)
            n=n/i;
         i++;
    }
    if (n>1) d++;
    cout<<d;
}

int main()
{
    freopen("uocnt.inp","r",stdin);
    freopen("uocnt.out","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    cin>>n;
    giai();
    return 0;
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.