Advertisement
cd62131

unsigned long long

Feb 15th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3. typedef unsigned long long ull;
  4. ull power(ull, ull);
  5. int main(void) {
  6.   ull xi, yi, zi;
  7.   printf("整数を入力してください: ");
  8.   scanf("%lld", &xi);
  9.   yi = 95;
  10.   zi = power(xi, yi);
  11.   printf("%lldの%lld乗は%lldです。それを323で割った余りは%lldです\n", xi, yi, zi, zi % 323);
  12.   printf("十六進数表示は%llxです", zi % 323);
  13.   return 0;
  14. }
  15. ull power(ull x, ull y) {
  16.   ull i, result;
  17.   for (i = 1, result = 1; i <= y; i++)
  18.     result *= x;
  19.   return result;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement