当前位置: 代码迷 >> 综合 >> 求约数的个数(模板)
  详细解决方案

求约数的个数(模板)

热度:79   发布时间:2024-01-19 07:53:44.0
#include <iostream>
#include <set>
#include <cmath>
using namespace std;
int main()
{int n;while(cin>>n&&n){int ans=1;int e=2;while(n!=1){int t=1;while(n%e==0){n=n/e;t++;}e++;ans*=t;}cout<<ans<<endl;}return 0;
}

 

  相关解决方案