typedef long long int ll_t;
-#ifndef _WIN32
+#ifdef __GNUC__
ll_t mul_ll(ll_t a, ll_t b) __attribute__((noinline));
ll_t shl_ll(ll_t a, ll_t b) __attribute__((noinline));
ll_t shr_ll(ll_t a, ll_t b) __attribute__((noinline));
return a - b;
}
-#if 0
ll_t div_ll(ll_t a, ll_t b) {
return a / b;
}
ll_t divmod_ll(ll_t a, ll_t b) {
return (a / b) + (a % b);
}
-#endif
ll_t neg_ll(ll_t a) {
return -a;
printf("%lld * %lld = %lld\n", a, b, mul_ll(a, b));
printf("%lld + %lld = %lld\n", a, b, add_ll(a, b));
printf("%lld - %lld = %lld\n", a, b, sub_ll(a, b));
-#if 0
- printf("%lld / %lld = %lld\n", a, b, div_ll(a, b));
- printf("%lld % %lld = %lld\n", a, b, mod_ll(a, b));
- printf("%lld / + % %lld = %lld\n", a, b, divmod_ll(a, b));
-#endif
- printf("%lld << %lld = %lld\n", a, 2, shl_ll(a, 2));
- printf("%lld >> %lld = %lld\n", a, 2, shr_ll(a, 2));
+ printf("%lld / %lld = %lld\n", b, a, div_ll(b, a));
+ printf("%lld %% %lld = %lld\n", b, a, mod_ll(b, a));
+ printf("%lld / + %% %lld = %lld\n", b, a, divmod_ll(b, a));
+ printf("%lld << %d = %lld\n", a, 2, shl_ll(a, 2));
+ printf("%lld >> %d = %lld\n", a, 2, shr_ll(a, 2));
printf("abs(%lld) = %lld\n", c, abs_ll(c));
printf("neg(%lld) = %lld\n", b, neg_ll(b));
#if 0
printf("conv(%lld) = %lf\n", c, conv_ll_d(c));
printf("conv(%lf) = %lld\n", d, conv_d_ll(d));
#endif
-
return 0;
}