1.无参函数
/* Note:Your choice is C IDE */
#include "stdio.h"
void sayhello()
{ printf("hello cai hua long");}
void main()
{ sayhello();}
2。求平方根
/* Note:Your choice is C IDE */
#include "stdio.h"
#include "math.h"
double hualong( double x,double y)
{
double z;
z=sqrt(x*x+y*y);
return z;}
int main()
{
double x,y,z;
x=3;
y=4;
z=hualong(x,y);
printf("x=%f,y=%f,z=%f\n");
}
3。Scanf 求平方根
/* Note:Your choice is C IDE */
#include "stdio.h"
#include "math.h"
double hualong(double x, double y)
{
double z;
scanf("%lf %lf",&x,&y);
z=sqrt(x*x+y*y);
printf("%lf\n",z);
return z;
}
void main()
{
double x,y;
hualong(x,y);
}
4。求三个数的平方和的根
/* Note:Your choice is C IDE */
#include "stdio.h"
#include "math.h"
double hualong(double x, double y)
{
double z;
scanf("%lf %lf",&x,&y);
z=sqrt(x*x+y*y);
printf("%lf\n",z);
return z;
}
void main()
{
double x,y;
hualong(x,y);
}