#includestdio.h
创新互联主营天水网站建设的网络公司,主营网站建设方案,手机APP定制开发,天水h5微信小程序开发搭建,天水网站营销推广欢迎天水等地区企业咨询
void main()
{
int max(int x,int y,int z);
int min(int x,int y,int z) ;
int a,b,d,c;
scanf("%d,%d,%d",a,b,c);
d=max(a,b,c);
printf("max=%d\n",d);
d=min(a,b,c);
printf("min=%d\n",d);
}
int max(int x,int y,int z)
{
int q;
if(xyxz) q=x;
else if(yzyx) q=y;
else q=z;
return(q);
}
int min(int x,int y,int z)
{
int q;
if(xyxz) q=x;
else if(yzyx) q=y;
else q=z;
return(q);
}
#include stdio.h
float max(float a[])
{
int i;
float m = a[0];
for(i=1;i10;i++)
{
if(ma[i])
m = a[i];
}
return m;
}
float min(float a[])
{
int i;
float m = a[0];
for(i=1;i10;i++)
{
if(ma[i])
m = a[i];
}
return m;
}
float aver(float a[])
{
float sum = 0;
int i;
for(i=0;i10;i++)
sum += a[i];
return sum / 10;
}
int main()
{
float num[10];
int i;
for(i=0;i10;i++)
scanf("%f",num[i]);
printf("The max number is %f\n",max(num));
printf("The min number is %f\n",min(num));
printf("The average number is %f\n",aver(num));
return 0;
}
做任务 烦请采纳
#include "stdafx.h"
#include stdio.h
float fun_perimeter(float r)
{
return 3.14*2*r;//圆的周长
}
float fun_area(float r)
{
return 3.14*r*r;//圆的周长
}
float fun_volume(float r)
{
return (4/3)*3.14*r*r*r;//球体的体积
}
int main(int argc, char* argv[])
{
float R;
printf("请输入半径:\n");
scanf("%f",R);
printf("半径为%0.2f的圆的周长是%0.2f,面积是%0.2f\n",R,fun_perimeter(R),fun_area(R));
printf("半径为%0.2f的球体体积是%0.2f\n",R,fun_volume(R));
return 0;
}