求下面算法的时间复杂度
void func(int n) { int k=n; while(k!=1){ int tot=0; for(int i=2;i<=sqrt(k);i++){ if(k%i==0){ k/=i; tot++; pri[++cnt]=i; } } if(tot==0) break; } }