C語言練習,求x的y次方的代碼

下面的代碼是關於C語言練習,求x的y次方的代碼,但願能對碼農們有一些好處。 

#include<stdio.h>
#include<math.h>
int main()
{
    int x, y, z;
    printf("Welcome to use!n");
    printf("Please input X:");
    scanf("%d",&x);

    printf("Please input Y:");
    scanf("%d",&y);

    z=pow(x,y);

    printf("You`ve inputed X=%d/Y=%dn",x,y);
    printf("The final result is %d",z);

    return 0;
}                                                                                                                                            複製代碼
相關文章
相關標籤/搜索