将任意三个数按从大到小输出
来源:互联网 发布:网络教育怎么 编辑:程序博客网 时间:2024/06/05 14:35
#include<stdio.h>void swap(int* a, int* b, int* c) //交换函数,实现将最大值传给a,最小值传给c{int tmp;if (*a >*b){if (*b >=*c) //即a>b>creturn;else //即a>c>=b{tmp = *b;*b = *c;*c = tmp;} }else {if (*a>*c) //即b>a>c{tmp = *a;*a = *b;*b = tmp;}else{if (*b < *c) //即c>b>a{tmp = *a;*a = *c;*c = tmp;}else //即b>c>a{tmp = *a;*a = *b;*b = *c;*c = tmp;}}}}int main(){ int a, b, c;void swap(int* a, int* b, int* c); //声明交换函数printf("Please Enter Three numbers:");scanf("%d %d %d", &a, &b, &c); swap(&a, &b,&c);printf("Output Three Numbers From Big To Small\n");printf("%d,%d,%d\n",a,b,c);return 0;}
阅读全文
0 0
- 将任意三个数按从大到小输出
- 将三个数按从大到小输出。
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数按从大到小输出。
- 将三个数按从大到小输出
- 将三个数按从大到小输出。
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数按从大到小输出
- 将三个数从大到小输出
- 将三个数从大到小输出
- c语言:将三个数按从大到小输出。
- C语言 将三个数按从大到小输出
- 将三个数按从大到小顺序输出
- bzoj4563: [Haoi2016]放棋子
- 初识JavaScript01
- 【matlab图像处理】matlab图像处理常见函数及联系
- Spring Boot 注解笔记
- 微信Android SDK反编译还原源码 进行修改重新编译
- 将任意三个数按从大到小输出
- 在Windows下同时安装Python2.x和Python3.x
- 逃离东北两整年
- 10.8
- 简单理解javascript中apply()和call()
- python--leetcode485. Max Consecutive Ones
- 二维码扫描
- 会话跟踪的多种方法
- 游戏小透明与Construct 2的初次邂逅