Euler_test.cpp 275 B

123456789101112131415
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #include "Euler.cpp"
  4. int main() {
  5. int n = 15;
  6. int res[] = {-1,1,1,2,2,4,2,6,4,6,4,10,4,12,6,8};
  7. phi_table(n);
  8. for (int i = 1; i <= n; i++){
  9. assert(phi[i] == euler_phi(i));
  10. assert(phi[i] == res[i]);
  11. }
  12. return 0;
  13. }