当前位置:网站首页>How to call the size of two numbers with a function--- Xiao Tang
How to call the size of two numbers with a function--- Xiao Tang
2022-07-25 22:11:00 【Xiaotang blog】
#include <stdio.h>
{
void printfwelcome()
{
printf("=====================================\n");
printf("\n");
printf("\t Welcome to Xiaotang applet !\n");
printf("\n");
printf("=====================================\n");
}
// Start encapsulating function
int getMaxFromData(int x,int y,int z)
{
int sum;
/* if(x>y) { z=x; }else { z=y; } return z; } int getMinFromData(int x,int y) { int z; if(x<y) { z=x; }else { z=y; } return z; } */
// Three eye algorithm
sum=x>y?x:y;
sum=x>z?x:z;
}
int getMinFromData(int x, int y, int z)
{
int sum;
sum=x<y?x:y;
sum=x<z?x:z;
}
int main()
{
int data1;
int data2;
int data3;
int bigOne;
int SmallOne;
printfwelcome();
printf(" Please enter three numbers :\n");
scanf("%d%d%d",&data1,&data2,&data3);
bigOne=getMaxFromData(data1,data2,data3);
SmallOne=getMinFromData(data1,data2,data3);
printf(" The three numbers you entered are :%d,%d,%d\n",data1,data2,data3);
printf(" The largest of these two numbers is %d, The smallest is %d\n",bigOne,SmallOne);
printf("\t Program end !");
return 0;
}
边栏推荐
- Don't vote, software testing posts are saturated
- [51nod1676 undirected graph isomorphism] undirected graph hash [easy to understand]
- Flex layout
- Animation curves are used every day. Can you make one by yourself? After reading this article, you will!
- 虚拟内存与磁盘
- Don't know mock test yet? An article to familiarize you with mock
- Redis memory elimination mechanism?
- YUV420 yuv420sp image format "recommended collection"
- 8000 word super detailed custom structure type
- [Fantan] how to design a test platform?
猜你喜欢

6-18漏洞利用-后门连接

Animation curves are used every day. Can you make one by yourself? After reading this article, you will!

磁盘空间的三种分配方式

关于接口测试你想知道的都在这儿了

Ts:typera code fragment indentation display exception (resolved) -2022.7.24

Playwright tutorial (I) suitable for Xiaobai

jenkins+SVN配置

【C语法】void*浅说

Wechat applet application development competition works comprehensive development record - Jinlu cultural tourism (cloud development - Overview)

『Skywalking』. Net core fast access distributed link tracking platform
随机推荐
Square root of X
[assembly language 01] basic knowledge
Playwright tutorial (I) suitable for Xiaobai
Ts:typera code fragment indentation display exception (resolved) -2022.7.24
Output Yang Hui triangle with two-dimensional array
golang : MVC之models
【汇编语言01】基础知识
2022 love analysis ― bank digitalization practice report
【C语法】void*浅说
Basic knowledge in the project
开户就可以购买收益在百分之六以上的理财产品了吗
动画曲线天天用,你能自己整一个吗?看完这篇你就会了!
Redis foundation 2 (notes)
[test development methodology] experience of test development platform PK - choice
jenkins+SVN配置
SQL basic statement DQL select and extract DML insert delete
Unity performance optimization direction
Usage of in in SQL DQL query
Ansible+cronab batch deployment patrol
EL表达式改进JSP