我只想说,因式分解,我这辈子都忘不掉怎么写

map <int,int> M ;
int temp=x ;
for(int i=2 ;i*i<=x ;i++)
{
    if(temp%i==0)
    {
        while(temp%i==0)
        {
            M[i]++ ;
            temp/=i ;
        }
    }
}
if(temp>1)M[temp]=1 ;//忘了这句话就是SB 
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2022-01-23
  • 2021-11-30
  • 2021-07-22
  • 2021-10-03
猜你喜欢
  • 2021-11-27
  • 2022-02-17
  • 2021-05-24
  • 2021-10-06
  • 2021-11-05
  • 2021-06-14
相关资源
相似解决方案