被老胡这么一刺激,俺这几天很激动,不能集中注意力。有这么个简单问题都想不清白,放这里请教:
一个整数N,N大小满足:
-M<N<2*M
这里M是正整数。编程实现一个函数f such that:
f(N) = N, if 0<=N<=M;
f(N) = N+M, if -M<N<0;
f(N) = N-M, if M<N<2*M.
可以用C,汇编。
问题是,最快的方法是啥?
注意哈,不是竞赛题,所以M 就是可以 int32 什么的。
作对了的找老胡去领奖~~~
被老胡这么一刺激,俺这几天很激动,不能集中注意力。有这么个简单问题都想不清白,放这里请教:
一个整数N,N大小满足:
-M<N<2*M
这里M是正整数。编程实现一个函数f such that:
f(N) = N, if 0<=N<=M;
f(N) = N+M, if -M<N<0;
f(N) = N-M, if M<N<2*M.
可以用C,汇编。
问题是,最快的方法是啥?
注意哈,不是竞赛题,所以M 就是可以 int32 什么的。
作对了的找老胡去领奖~~~
•
回复:我来出道题考考大家
-怪哉-
♂
(117 bytes)
()
03/02/2012 postreply
10:36:24
•
老胡尿遁
-虎虎生威-
♀
(0 bytes)
()
03/02/2012 postreply
10:51:17
•
回复:老胡尿遁
-怪哉-
♂
(107 bytes)
()
03/02/2012 postreply
10:57:30
•
How about template C++?
-灰衣人-
♂
(112 bytes)
()
03/02/2012 postreply
12:20:36
•
谢谢,好主意
-怪哉-
♂
(51 bytes)
()
03/02/2012 postreply
12:26:30
•
回复:How about template C++?
-怪哉-
♂
(22 bytes)
()
03/02/2012 postreply
13:29:03
•
回复:回复:How about template C++?
-灰衣人-
♂
(288 bytes)
()
03/02/2012 postreply
13:37:49
•
我们都看出来了,你有点怪!
-眼冒金星-
♂
(0 bytes)
()
03/02/2012 postreply
14:48:48
WENXUECITY.COM does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by other users.
Copyright ©1998-2025 wenxuecity.com All rights reserved. Privacy Statement & Terms of Use & User Privacy Protection Policy