质因数分解

质因数分解题面

#include<iostream>
#include<cstdio>

#include<cmath>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            printf("%d\n",n/i);
            break;
        }
    }
    return 0;
}

可爱的题~\(≧▽≦)/~啦啦啦

猜你喜欢

转载自www.cnblogs.com/xrj1229/p/9222721.html