week_9

来源:互联网 发布:淘宝店铺2心要多少单 编辑:程序博客网 时间:2024/06/05 19:02

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
原创粉丝点击