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+"行","韩信将兵人数");
        }

相关文章:

  • 2021-11-16
  • 2022-12-23
  • 2021-08-30
  • 2022-02-18
  • 2021-11-12
  • 2022-02-14
  • 2021-12-03
  • 2022-12-23
猜你喜欢
  • 2021-09-27
  • 2022-03-09
  • 2021-05-16
  • 2022-12-23
相关资源
相似解决方案