Thứ Bảy, 4 tháng 12, 2021

TIMUOC C++


#include <bits/stdc++.h>
using namespace std;
long long n;
void xuli()
{
    int t=0;
    cin>>n;
    for(int i=1;i<=int(sqrt(n));i++)
    {
        if(n%i==0)
        {
            t=t+2;
        }
    }
    if(int(sqrt(n))==sqrt(n))
    {
        t=t-1;
    }
    cout<<t;
}
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  //  freopen("timuoc.inp","r",stdin);
  //  freopen("timuoc.out","w",stdout);
    xuli();
}


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.