數論 歐拉函數

數論 歐拉函數 基礎題 (板子) C++ AC代碼: #include using namespace std; void ha(int x) { int ans=x; for(int i=2;ii<=x;i++){ if(x%i==0){ ans=ans/i(i-1); while(x%i==0) x=x/i; } } if(x>1) ans=ans/x*(x-1); cout<<ans<<en
相關文章
相關標籤/搜索