比如 class Program
{
static void Main(string[] args)
{
for (int y = 20; y <= 100; y++)
{
for (int z = 10; z >= 0; z--)
{
for (int x = 0; x < 33; x++)
{
int sum = x * 300 + y * 100 + z * 550;
int money = x * 500 + y * 35 + z * 1200;
if (sum < 10000)
{
Console.WriteLine("{0}*500+{1}*35+{2}*1200={3}",x,y,z,money);
}
}
}
}
}
}
对money排序。
{
static void Main(string[] args)
{
for (int y = 20; y <= 100; y++)
{
for (int z = 10; z >= 0; z--)
{
for (int x = 0; x < 33; x++)
{
int sum = x * 300 + y * 100 + z * 550;
int money = x * 500 + y * 35 + z * 1200;
if (sum < 10000)
{
Console.WriteLine("{0}*500+{1}*35+{2}*1200={3}",x,y,z,money);
}
}
}
}
}
}
对money排序。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货