标签:
static void Main(string[] args)
{
while (true)
{
int m = 0;
for (int x = 0; 1*x <= 20; x++)
{
for (int y = 0; 5*y <=20; y++)
{
for (int z = 0; 2*z<=20; z++)
{
if (x+5*y+2*z==20)
{
Console.WriteLine(x+"个1块钱"+y+"个5快钱");
m = m + 1;
}
}
}
}
Console.WriteLine("有"+m+"种方法");
Console.ReadLine();
}
}
标签:
原文地址:http://www.cnblogs.com/dlexia/p/4384196.html