佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

12
返回列表 发新帖
楼主: 無聊人

水果之谜

[复制链接]
发表于 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, 够简单吧!
回复

使用道具 举报


ADVERTISEMENT

发表于 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

如果有什么疑问不妨提出..

对不起,最近比较忙,没有时间看你的问题.

还有,请尽量使用中文...
谢谢.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 4-6-2024 12:14 AM , Processed in 0.053955 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表