以下函数的功能是计算x的y次方

#include<stdio.h>
void main()
{
float fun(float,int);
float a;
int n;
scanf("%f",&a);
scanf("%d",&n);
printf("%.3f",fun(a,n));
}
float fun(float x,int y)
{
int i=1;
float fz=1;
if(y==0)
return 1;
while(

3分
)
{


3分
;
i++;
}
return fz;
}


#include<stdio.h>
void main()
{
    float fun(float,int);
    float a;
    int n;
    scanf("%f",&a);
    scanf("%d",&n);
    printf("%.3f",fun(a,n));
}
float fun(float x,int y)
{
    int i=1;
    float fz=1;
    if(y==0)
        return 1;
    while(i<=y)
    {

        fz *=x;
        i++;
    }
    return fz;
}