for
for循环
/*
* 由SharpDevelop创建。
* 用户: Administrator
* 日期: 2022/12/5
* 时间: 10:36
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using System.Runtime.InteropServices;
namespace hello_world
{
class Program
{
public static void Main(string[] args)
{
int g1;
int g2;
int g3;
int age;
for(g1=6;g1<13;g1++)
{
for (g2 = 1; g2 <= 5; g2++)
for (g3 = 1; g3 <= 5; g3++)
if (g1 + g2 + g3 == 13)
for (age = 13; age < 200; age++)
if (g1 * g2 * g3 == age)
Console.WriteLine("这是{0},{1},{2},{3}", g1, g2, g3,age);
//else
//Console.WriteLine("不是{0}", age);
}
Console.ReadLine();
}
}
}