1 /*被调用函数出现在主调用函数之前*/ 2 #include<stdio.h> 3 float cube(float x); 4 int main(void) 5 { 6 float a,product; 7 printf("Please input value of a:\n"); 8 scanf("%f",&a); 9 product=cube(a); 10 printf("Cube of %.4f is %.4f\n",a,product); 11 return 0; 12 } 13 float cube(float x) 14 { 15 float y; 16 y=x*x*x; 17 return (y); 18 } 19