#include <stdio.h> void main()
提示用带参数的函数。
----------------解决方案--------------------------------------------------------
#include <stdio.h>
#include<math.h>
float gets(float,float,float);
void main()
{
float x,y,z,s;
printf("input x,y,z:");
scanf("%f,%f,%f",&x,&y,&z);
s=gets(x,y,z);
printf("s=%f",s);
}
float gets(float x,float y,flaot z)
{
return(pow(x,3)+pow(y,3)+pow(z,3));
}
----------------解决方案--------------------------------------------------------
#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));
}
----------------解决方案--------------------------------------------------------