正在加载图片...
include <stdio. h define PI 3.14 问题 flat( float):/函数声明 float s( float):腆函数声明 若这样起名会 flat(f|la↑r)函数定义:求周长* 怎样? [return Prr*2: 3 float s(fltn)/函数定义:求面积 [return parr:y 会有错误提示, void maino ○ 因为相同的名字 [ float 造成了冲突。 printf("please input r: ) scanf( %f", &r): l=(r):函数调用*/ s=s(r):函数调用*/ printf circumference=77 2f\n, area=77 2f\n",I, s):3 #include <stdio.h> #define PI 3.14 float l(float); /*函数声明*/ float s(float); /*函数声明*/ float l(float r) /*函数定义:求周长*/ {return PI*r*2; } float s(float r) /*函数定义:求面积*/ { return PI*r*r; } void main() { float r, l, s; printf("please input r:"); scanf("%f",&r); l=l(r); /*函数调用*/ s=s(r); /*函数调用*/ printf("circumference=%7.2f\n,area=%7.2f\n", l, s); } 问题 若这样起名会 怎样? 会有错误提示, 因为相同的名字 造成了冲突
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有