Advertisement
LuongIT

nháp_với_CT_con

Dec 19th, 2015
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. void Nhap (int &a, int &b)
  3. {
  4.     printf("Nhap x: ");
  5.     scanf("%d", &a);
  6.     printf("Nhap n: ");
  7.     scanf("%d", &b);
  8. }
  9. int HamMu (int x, int n)
  10. {
  11.     int i = 2;
  12.     while (i <= n)
  13.     {
  14.         x *= x;
  15.         i++;
  16.     }
  17. }
  18. int main()
  19. {
  20.     int x,n;
  21.     Nhap(x,n);
  22.     printf("%d^%d = %d", x, n, HamMu(x,n));
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement