|
发表于 14-3-2004 09:56 PM
|
显示全部楼层
我有个很简单但比较闷的方法!
for A = 1 : 100
for B = 1 : 100
for C = 1 : 100
if A+B+C == 100 && 5*A+B+0.1*C == 50
return (A,B,C);
endif
endfor; endfor; endfor;
haha, 够简单吧! |
|
|
|
|
|
|
|
发表于 21-7-2004 09:23 PM
|
显示全部楼层
多普勒效应 于 12-3-2004 11:53 PM 说 :
Uncertain Equation 呀!!
设西瓜 x 粒,黄离 y 粒 ,香蕉 z 条。
50x + 10y + z =500 ------(1)
and x + y + z =100 -------(2)
(1)-(2) =>
49x + 9y =400
用Euclidean A ...
可以解释一下如何使用Euclidean Algorithm 或 modular arithmetics
得 x = 9u + 1
y = 39 - 49u 吗? |
|
|
|
|
|
|
|
发表于 22-7-2004 11:54 AM
|
显示全部楼层
how to use Euclidean Algorithm or modular arithmetics in this questions
X=Pears per bag=$2.00, Y=Apples per bags=$3.00, Z=Rock Melon= $6.00 per bags and total number of fruits =24 bags for $77 dollars.
I found that it had 6 possibilities
X Y Z Total
25 1 >24
1 21 2 24 77
4 17 3 24 77
7 13 4 24 77
10 9 5 24 77
13 5 6 24 77
16 1 7 24 77 |
|
|
|
|
|
|
|
发表于 22-7-2004 09:46 PM
|
显示全部楼层
森崎二郎 于 22-7-2004 11:54 AM 说 :
X=Pears per bag=$2.00, Y=Apples per bags=$3.00, Z=Rock Melon= $6.00 per bags and total number of fruits =24 bags for $77 dollars.
I found that it had 6 possibilities
X Y Z Total
25 1 &g ...
这题是不同的一题了是吗?
关于euclidean algorithm 可以参考旧贴http://chinese.cari.com.my/myfor ... d=20761&fpage=6
如果有什么疑问不妨提出..
对不起,最近比较忙,没有时间看你的问题.
还有,请尽量使用中文...
谢谢. |
|
|
|
|
|
|
| |
本周最热论坛帖子
|