for (int x=1;x<=12;x++ )//请填写代码
{
Console.WriteLine(x+" ");
}
{
Console.WriteLine(x+" ");
}
2016-05-02
int x = 1;
int sum = 0;//和,初始化为0
while (x <= 30)//循环条件
{
if (x%2==1)//筛选条件
{sum += x;
x++;
}
}
Console.Write("1-30奇数的和:"+sum);
int sum = 0;//和,初始化为0
while (x <= 30)//循环条件
{
if (x%2==1)//筛选条件
{sum += x;
x++;
}
}
Console.Write("1-30奇数的和:"+sum);
2016-05-02