zoukankan      html  css  js  c++  java
  • 博饼算法

    while (true)
                {
                    Console.ReadLine();
                    string result = "";
                    Random ran = new Random();
                    for (int i = 0; i < 6; i++) result += ran.Next(1, 7).ToString();
                    Console.WriteLine(result);
                    int one = result.Count(r => r == '1');
                    int two = result.Count(r => r == '2');
                    int three = result.Count(r => r == '3');
                    int four = result.Count(r => r == '4');
                    int five = result.Count(r => r == '5');
                    int sex = result.Count(r => r == '6');
                    if (four == 6) Console.WriteLine("六杯红");
                    else if (four == 4 && one == 2) Console.WriteLine("插金花");
                    else if (one == 6) Console.WriteLine("遍地锦");
                    else if (sex == 6 || five == 6 || three == 6 || two == 6) Console.WriteLine("黑六勃");
                    else if (four == 5 && one == 1) Console.WriteLine("五红");
                    else if (sex == 5 || five == 5 || three == 5 || two == 5 || one == 5) Console.WriteLine("五子登科");
                    else if (four == 4) Console.WriteLine("四点红");
                    else if (one == 1 && two == 1 && three == 1 && four == 1 && five == 1 && sex == 1) Console.WriteLine("对堂");
                    else if (one == 4 || two == 4 || three == 4 || five == 4 || sex == 4) Console.WriteLine("四进");
                    else if (four == 3) Console.WriteLine("三红");
                    else if (four == 2) Console.WriteLine("二举");
                    else if (four == 1) Console.WriteLine("一秀");
                    else Console.WriteLine("谢谢参与");
                }
    

      

  • 相关阅读:
    python接口测试
    python selenium 判断元素是否可见
    python学习之天气爬虫
    python学习之图片爬虫
    python学习之小说爬虫
    webdriver学习——css调试,jquery调用
    webdriver学习——百度设置
    bat中获取当前路径
    搭建ant脚本,全量/增量/减量包
    查询数据库中各个类型的方法名称
  • 原文地址:https://www.cnblogs.com/Lance-Lan/p/3356638.html
Copyright © 2011-2022 走看看