第九话。

来源:互联网 发布:网络规划设计任务书 编辑:程序博客网 时间:2024/05/02 13:58

1 写一个无参数无返回值的函数sayHello,并在main中执行

#include "stdio.h"  void a(void){     printf("sayhello");}     int main()  {     a();       }  


2 写一个求x、y的平方和的平方根的函数,并在main中执行

#include "stdio.h"  #include "math.h"  double a(){      double x,y,b,c;      scanf("%lf %lf",&x,&y);      b=x*x+y*y;      c=sqrt(b);      return c;      }  main()  {      printf("%lf",a());  }  


 

0 0
原创粉丝点击