Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tinh T(x,n) = x^n
- // khai bao thu vien
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- // khai bao bien
- int x,n;
- // nhap du lieu
- scanf("%d%d",&x,&n);
- long T=1;
- if(n==0&&x==0)
- printf("Khong xac dinh");
- else
- {
- if(x==0)
- {
- printf("0");
- }
- else
- {
- for(int i=1;i<=n;i++)
- {
- T=T*x;
- }
- printf("%ld",T);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement