C语言:用指针这样求圆的直径,面积和周长哪里错了呢?#include#define Pai 3.14void zhijing_mianji_zhouchang(double r,double );main(){double r,mianji,zhouchang,zhijing;printf("请输入半径");scanf("%lf",&r);zhijing_mianji_zhouchan

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/28 20:48:35
C语言:用指针这样求圆的直径,面积和周长哪里错了呢?#include#definePai3.14voidzhijing_mianji_zhouchang(doubler,double);main(){

C语言:用指针这样求圆的直径,面积和周长哪里错了呢?#include#define Pai 3.14void zhijing_mianji_zhouchang(double r,double );main(){double r,mianji,zhouchang,zhijing;printf("请输入半径");scanf("%lf",&r);zhijing_mianji_zhouchan
C语言:用指针这样求圆的直径,面积和周长哪里错了呢?
#include
#define Pai 3.14
void zhijing_mianji_zhouchang(double r,double );
main()
{double r,mianji,zhouchang,zhijing;
printf("请输入半径");
scanf("%lf",&r);
zhijing_mianji_zhouchang(r,&zhijing,&mianji,&zhouchang);
printf("直径为%lf,面积为%lf,周长为%lf",zhijing,mianji,zhouchang);
}
zhijing_mianji_zhouchang(double r,double *p1,double *p2,double *p3)
{*p1=r*2;
*p2=Pai*r*r;
*p3=Pai*(r*2);
}

C语言:用指针这样求圆的直径,面积和周长哪里错了呢?#include#define Pai 3.14void zhijing_mianji_zhouchang(double r,double );main(){double r,mianji,zhouchang,zhijing;printf("请输入半径");scanf("%lf",&r);zhijing_mianji_zhouchan
函数声明都不对啊!一共四个参数怎么就声明两个参数?