没仔细看。 不过至少
当a, b 确定后, c就直接可求,不必要再循环了。

解决方案 »

  1.   

    0.1X+3Y+6(100-X-Y)=100
    (0<=X<=100,0<=Y<=100)
    解方程
      

  2.   

    这样如何?
    using System;namespace _5th
    {
    /// <summary>
    /// Class1 的摘要说明。
    /// </summary>
    class Class1
    {
    /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]

    static void Main(string[] args)
    {
    for (sbyte a=10;a<90;a+=10)
    {
    for (sbyte b=1;b<33;b++)
    {
    if ((0.1*a+3*b+(100-a-b)*6)==100)
    { Console.WriteLine("A={0},B={1},C={2}",a,b,100-a-b);}
    /*for (sbyte c=1;c<16;c++)
    {
    if ((0.1*a+3*b+6*c==100) & (a+b+c==100))
    {
    Console.WriteLine ("A={0}\tB={1}\tC={2}",a,b,c);
    Console.ReadLine();
    }
    }
    */
    }
    }
    } }
    }