追求完美
希望在自己脚下,命运在自己手中
博客园
闪存
首页
新随笔
联系
管理
订阅
随笔- 19 文章- 2 评论- 39
11 2009 档案
不用判断语句,求两个数的最大值
摘要: 不用判断语句,求两个数的最大值我面试时的一道题,当时没有解决,现在总算是知道了,呵呵#include "stdio.h"int max(int x,int y) { int buf[2]={x,y}; unsigned int z; z=x-y; z = z>>31; return buf[z]; } void main(void){ int ma; ma=max(2,-1); pri...
阅读全文
posted @
2009-11-30 16:36
MushRoom_lb 阅读(640) |
评论 (4)
编辑
公告