| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 901 人关注过本帖, 1 人收藏
标题:C语言中怎么实现随机?
取消只看楼主 加入收藏
jiangzhaoron
Rank: 1
等 级:新手上路
帖 子:4
专家分:3
注 册:2010-10-12
结帖率:0
收藏(1)
已结贴  问题点数:20 回复次数:2 
C语言中怎么实现随机?
using System;
using System.Collections.Generic;
using System.Text;
//自已写算法插件时需要注意以下几点:
//1、文件名与命名空间、类名必须一致;
//2、共有方法getValue()和getIniValue()的返回值类型和参数类型不得修改
//3、可以增加命名空间;
//3、数据的长度为16;
//4、可以构建自己的复杂的算法,
namespace zhong91011b
{
   
    public class zhong91011b : VoteMethod.MethodPluginInterface
{
        int[] ieggs = new int[16] {1, 1, 2, 3, 5, 0, 0, 0, 0, 0, 0, 5, 3, 2, 1, 1};
        int[] pv = new int[16] {200, 72, 38, 29, 14, 10, 8, 7, 7, 8, 10, 14, 23, 38, 77, 200};
        int[] ieggs1 = new int[16] {1, 1, 2, 3, 5, 0, 0, 0, 0, 0, 0, 5, 3, 2, 1, 1};
        int[] oeggs = new int[16] {0, 0, 0, 0, 0, 0, 8, 8,8, 0, 0, 0, 0, 0, 0, 0};
        int[] oeggs1 = new int[16] {0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0};
        int cetext=0;
        int j=0;
        public int[] getValue(int[] eggs, int code)
        {
             int i;
         if (cetext%2 != 0)
          {
             if ((code <9) || (code >11))
                  {
                  
                    for(i=0;i<16;i++)
                      {
                        eggs[i]=ieggs1[i]*2;
                        ieggs1[i]=ieggs1[i]*2;
                        oeggs1[i]=oeggs1[i]*2;
                         }
                     cetext=cetext+1;
                    return eggs;
                  }
         
             for (i=0;i<16;i++)
                  {
                   eggs[i]=ieggs[i];
                   ieggs1[i]=ieggs[i];
                   oeggs1[i]=oeggs[i];
                   }
               cetext=cetext+1;
            }
         else{   
             cetext=cetext+1;   
             if ((code >7) && (code <14))
                  {
                    for(i=0;i<16;i++)
                      {
                        eggs[i]=oeggs1[i]*2;
                        oeggs1[i]=oeggs1[i]*2;
                        ieggs1[i]=ieggs1[i]*2;
                         }
                      j=j+1;
                     return eggs;
                  }
               
             for (i=0;i<16;i++)
                  {
                   eggs[i]=oeggs[i];
                   oeggs1[i]=oeggs[i];
                   ieggs1[i]=ieggs[i];
                   }
            }
              
                       
            return eggs;
        }
        public int[] getIniValue()
        {
            
            return ieggs;
        }
    }
}




说明:这个是个自动投注的编码,两组数交替投注,不中翻倍,现在想改成两组数随机投注,不中翻倍,请大家帮忙指导,不尽感激。
搜索更多相关主题的帖子: C语言 随机 
2010-10-12 21:45
jiangzhaoron
Rank: 1
等 级:新手上路
帖 子:4
专家分:3
注 册:2010-10-12
收藏
得分:0 
新手求助
2010-10-12 21:59
jiangzhaoron
Rank: 1
等 级:新手上路
帖 子:4
专家分:3
注 册:2010-10-12
收藏
得分:0 
没人帮忙呀
2010-10-13 08:39
快速回复:C语言中怎么实现随机?
数据加载中...
 
   



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

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