调用自定义函数,输入三个任意整数,找出其中的最大值并输出


#include<stdio.h>

void max(int a,int b, int c)

{

int t;

if (a>b)

t=a;

else

t=b;

if (t < c)

t=c;

printf("三个数的最大值为%d:",t);

}

int main()

{

int a,b,c;

printf("请依次输入三个数值:");

scanf("%d%d%d",&a,&b,&c);

max(a,b,c);

return 0;

}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM