zoukankan      html  css  js  c++  java
  • 韩信将兵(普通算法)

    private void button1_Click(object sender, EventArgs e)
            {
                int x = 0;
                int y = 0;
                int z = 0;

                for (int i = 1; i <= 33; i++)
                {
                    for (int j = 1; j <= 14; j++)
                    {
                        for (int k = 1; k <= 20; k++)
                        {
                            if (3 * i +1 == 7 * j  -2&& 7 * j -2 == 5 * k)
                            {
                                x = i;
                                y = j;
                                z = k;
                            }
                        }
                    }
                }
                MessageBox.Show("算出来了" +(3*x +1) + "人,3人一行排列" + x + "行,7人一行排列" + y +"行,5人一行排列" +z+"行","韩信将兵人数");
            }

  • 相关阅读:
    LeetCode 128. 最长连续序列
    MySQL的information_schema
    maven项目板块的pom.xml配置
    mybatis打印SQL日志
    MySQL的时间字段转换
    mysql的csv数据导入与导出
    一致性协议
    分布式事务
    事务基本信息
    分布式系统定义及特点
  • 原文地址:https://www.cnblogs.com/armanda/p/2591511.html
Copyright © 2011-2022 走看看