1 条题解

  • 0
    @ 2023-3-2 20:00:20
    #include<bits/stdc++.h>
    using namespace std; 
    int n,a[100001]={0};
    void zzh(int k,int l)
    {
    	while(1)
    	{
    		if(n%l!=0)
    		{
    			return;
    		}
    		if(n<=l)
    		{
    			cout<<l;
    		} 
    		else
    		{
    			cout<<l<<"*";
    		}
    		n=n/l;
    	}
    }
    int main()
    {
        cin>>n;
        cout<<n<<"=";
        for(int i=2;i<=n;i++)
        {
            if(n%i==0)
            {
                a[i]=1;
                zzh(a[i],i); 
            }
        }
        return 0;
    }
    
    • 1

    信息

    ID
    1285
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    递交数
    30
    已通过
    19
    上传者