#include <stdio.h> void main()
提示用带参数的函数。
#include "stdio.h"
#include "math.h"
main()
{
float sumx(float x,float y,float z);
float a,b,c,sum;
printf("Input three float:\n");
scanf("%f%f%f",&a,&b,&c);
sum=sumx(a,b,c);
printf("Sum=%f",sum);
getch();
}
float sumx(float x,float y,float z)
{
return (pow(x,3)+pow(y,3)+pow(z,3));
}
练习函数的使用,不错
#include "stdio.h"
#include "math.h"
main()
{
float comx(float x,float y,float z);
float a,b,c,sum;
printf("Input three float:\n");
scanf("%f%f%f",&a,&b,&c);
sum=sumx(a,b,c);
printf("Sum=%f",sum);
getch();
}
float comx(float x,float y,float z)
{
return (pow(x,3)+pow(y,3)+pow(z,3));
}