| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 478 人关注过本帖
标题:谁帮忙给我改个算法啊~~急
只看楼主 加入收藏
shuangyi110
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2009-10-8
收藏
 问题点数:0 回复次数:0 
谁帮忙给我改个算法啊~~急
using System;
using System.Collections.Generic;
using System.Text;
using

namespace RollMethod
{
   
    public class RollMethod : VoteMethod.MethodPluginInterface
    {
        int[] ieggs = new int[16] { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 };
        int[] pv = new int[16] { 121, 72, 38, 29, 14, 10, 8, 7, 7, 8, 10, 14, 23, 38, 77, 213 };
        public int[] getValue(int[] eggs, int code)
        {
            
            for (int i = 0; i < 16; i++)
            {


                if (eggs[i] != 0)
                {
                    int oddegg = eggs[i];
                    while (true)
                    {

                        eggs[i] = eggs[i] + 1;
                        if ((eggs[i] - oddegg) * pv[i] > oddegg)
                        {
                            break;
                        }
                    }
                }

            }
            if (eggs[code - 3] != 0)
            {
                eggs[code - 3] = ieggs[code - 3];
            }
            return eggs;
        }
        public int[] getIniValue()
        {
            int[] eggs = new int[16] { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
            return eggs;
        }
    }
}
搜索更多相关主题的帖子: 算法 
2009-10-08 17:29
快速回复:谁帮忙给我改个算法啊~~急
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031887 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved