fork download
  1. #include <stdio.h>
  2.  
  3. void f835(int n) {
  4. int x = n / 6;
  5. int y = n % 6;
  6. int i;
  7. unsigned long long d = 1ULL;
  8. for (i = 0; i < x; i++) {
  9. d *= 9ULL;
  10. }
  11. if (y == 5) {
  12. d *= 6ULL;
  13. } else if (y > 0) {
  14. d *= (unsigned long long)y;
  15. }
  16. printf("x=%d -> %llu\n", n, d);
  17. }
  18.  
  19. int main(void) {
  20. // your code goes here
  21.  
  22. f835(10);
  23. f835(64);
  24. f835(100);
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
x=10 -> 36
x=64 -> 13947137604
x=100 -> 7412080755407364