1. for循环

  1. int a[] = {0, 1, 3, 9, 27, 33, 54, 81};
  2. for (i = 0; i < sizeof(a) / sizeof(int); ++i) {
  3. printf("%d, %d\n", a[i], isPowerOfThree(a[i]));
  4. }