1012
来源:互联网 发布:手机电脑无线传数据 编辑:程序博客网 时间:2024/05/28 18:42
# include<stdio.h>
void swap(int *, int *);
int main(void)
{
int a, b, c;
int *p1, *p2, *p3;
printf("输入 a, b ,c:\n");
scanf("%d %d %d", &a, &b, &c);
p1 = &a;
p2 = &b;
p3 = &c;
if(a>b)
swap(p1, p2);
if(a>c)
swap(p1, p3);
if(b>c)
swap(p2, p3);
printf("%d %d %d\n", a, b, c);
}
void swap(int *s1, int *s2)
{
int t;
t = *s1; *s1 = *s2; *s2 = t;
}
void swap(int *, int *);
int main(void)
{
int a, b, c;
int *p1, *p2, *p3;
printf("输入 a, b ,c:\n");
scanf("%d %d %d", &a, &b, &c);
p1 = &a;
p2 = &b;
p3 = &c;
if(a>b)
swap(p1, p2);
if(a>c)
swap(p1, p3);
if(b>c)
swap(p2, p3);
printf("%d %d %d\n", a, b, c);
}
void swap(int *s1, int *s2)
{
int t;
t = *s1; *s1 = *s2; *s2 = t;
}
0 0
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- 1012
- Soot -- 中间代码Jimple介绍
- SSH免密钥登录 ------Hadoop学习(2)
- 软考总结--面向对象技术
- Handler
- Python正则表达式
- 1012
- 资治通鉴
- 深度学习(BOT方向) 学习笔记(1) Sequence2Sequence 学习
- 基于sysbenche-0.5的MySQL自动压测及分析出图
- View 触摸事件分发拦截机制(二)
- jqgrid 使用总结
- 重拾Python 十一
- 入门oracle之游标
- 求斐波那契数列