int i = 0;
int sum; for (int b = 50; b <= 5000; b++)
{
for (int h = 30; h <= 3000; h++)
{
for (int p = 300; p <= 30000; p++)
{
sum = 168 * b + 120 * h + 5 * p;
if (sum == 20000)
{
Console.WriteLine("两万左右的: 白酒:{0},红酒:{1},啤酒:
{2},销售额:{3}", b, h, p, sum);
i++;
if(i>2)
goto xiayige;
Console.ReadKey();
}
}
}
}
xiayige:
for (int b=50; b <= 5000; b++)
{
for (int h=30; h <= 3000; h++)
{
for (int p=300; p <= 30000; p++)
{
sum = 168 * b + 120 * h + 5 * p;
if (sum ==45000)
{
Console.WriteLine("4.5 万左右的:白酒:{0},红酒:{1},啤酒:
{2},销售额:{3}", b, h, p, sum);
Console.ReadKey();
}
}
}
}
int sum; for (int b = 50; b <= 5000; b++)
{
for (int h = 30; h <= 3000; h++)
{
for (int p = 300; p <= 30000; p++)
{
sum = 168 * b + 120 * h + 5 * p;
if (sum == 20000)
{
Console.WriteLine("两万左右的: 白酒:{0},红酒:{1},啤酒:
{2},销售额:{3}", b, h, p, sum);
i++;
if(i>2)
goto xiayige;
Console.ReadKey();
}
}
}
}
xiayige:
for (int b=50; b <= 5000; b++)
{
for (int h=30; h <= 3000; h++)
{
for (int p=300; p <= 30000; p++)
{
sum = 168 * b + 120 * h + 5 * p;
if (sum ==45000)
{
Console.WriteLine("4.5 万左右的:白酒:{0},红酒:{1},啤酒:
{2},销售额:{3}", b, h, p, sum);
Console.ReadKey();
}
}
}
}