当前位置:网站首页>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;
}
边栏推荐
- What is the difference between minor GC and full GC?
- How to quickly build a picture server [easy to understand]
- What is class loading? Class loading process?
- 2年功能测试,却感觉自己什么都不会,2022我该何去何从?
- 数据库进阶·如何针对所有用户数据中没有的数据去加入随机的数据-蜻蜓Q系统用户没有头像如何加入头像数据-优雅草科技kir
- Wechat card issuing applet source code - automatic card issuing applet source code - with flow main function
- What have I experienced to become a harder tester than development?
- 『SignalR』. Net using signalr for real-time communication
- Randomly generate 10 (range 1~100) integers, save them to the array, and print the array in reverse order. And find the average value, the maximum value and the subscript of the maximum value, and fin
- [fan Tan] after the arrival of Web3.0, where should testers go? (ten predictions and suggestions)
猜你喜欢

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

Fill the whole square with the float property

Usage of in in SQL DQL query

『Skywalking』.NET Core快速接入分布式链路追踪平台

The technical aspects of ByteDance are all over, but the result is still brushed. Ask HR why...

ansible+Crontab批部署巡检

MySQL - subquery - column subquery (multi row subquery)

『SignalR』.NET使用 SignalR 进行实时通信初体验

自动化测试岗花20K招人,到最后居然没一个合适的,招两个应届生都比他们强吧

Jmeter---设置代理录制请求
随机推荐
Acwing 866. determining prime numbers by trial division
How is it most convenient to open an account for stock speculation? Is it safe for online account managers to open an account
Preliminary study on Tesseract OCR
On the difference between break and continue statements
How to use RS485 half duplex chip correctly
vim用法记录
Redis基础2(笔记)
YUV420 yuv420sp image format "recommended collection"
Dovecot set mailbox quota
Basic knowledge in the project
Wet- a good choice for people with English difficulties - console translation
6-17漏洞利用-反序列化远程命令执行漏洞
JS timer and swiper plug-in
Redis master-slave architecture lock failure problem (master-slave)
H5幸运刮刮乐抽奖 免公众号+直运营
测试工作不受重视,你换位思考了吗?
启牛商学院和微淼商学院哪个靠谱?老师推荐的开户安全吗?
Summary of function test points of wechat sending circle of friends on mobile terminal
Output Yang Hui triangle with two-dimensional array
TS:typora代码片段缩进显示异常(已解决)-2022.7.24