int[] num = new int[] { 3, 34, 42, 2, 11, 19, 30, 55, 20 };
for (int i = 0; i < num.Length; i++)
if (num[i] % 2 == 0)
{
Console.Write(num[i] + ",");
for (int i = 0; i < num.Length; i++)
if (num[i] % 2 == 0)
{
Console.Write(num[i] + ",");
string[] name=new string[]{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score = new int[] {89,90,98,56,60,91,93,85};
int max = score[0]; // max保存最大元素
int _max = 0; //保存最大元素下标,如果需要记录那个元素最大
int i;
int[] score = new int[] {89,90,98,56,60,91,93,85};
int max = score[0]; // max保存最大元素
int _max = 0; //保存最大元素下标,如果需要记录那个元素最大
int i;
static void Main(string[] args)
{
int y = 5;
while (y!=0)//请输入
{
Console.Write(y+" ");
y--;//请输入
}
}
}
{
int y = 5;
while (y!=0)//请输入
{
Console.Write(y+" ");
y--;//请输入
}
}
}
2016-10-27
switch (job)
{
case "局长": Console.Write("发双黄月饼"); break;
case "处长": Console.Write("发蛋黄月饼"); break;
case "科长": Console.Write("发枣泥月饼"); break;
default: Console.Write("发五仁月饼"); break;
}
{
case "局长": Console.Write("发双黄月饼"); break;
case "处长": Console.Write("发蛋黄月饼"); break;
case "科长": Console.Write("发枣泥月饼"); break;
default: Console.Write("发五仁月饼"); break;
}
2016-10-27
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string nima;//声明变量保存爱好
nima="你妈";//给爱好变量赋值
Console.WriteLine("我爱好"+nima);//打印变量
}
}
}
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string nima;//声明变量保存爱好
nima="你妈";//给爱好变量赋值
Console.WriteLine("我爱好"+nima);//打印变量
}
}
}
namespace Test
{
class Program
{
static void Main(string[] args)
{
const string XB = "女人";//常量,性别
const string Mingzi = "璐璐";//常量,姓名
Console.WriteLine(Mingzi+"是个"+XB+"的典范");//使用常量
}
}
}
{
class Program
{
static void Main(string[] args)
{
const string XB = "女人";//常量,性别
const string Mingzi = "璐璐";//常量,姓名
Console.WriteLine(Mingzi+"是个"+XB+"的典范");//使用常量
}
}
}
string[] job =new string[] {"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印职位
}
Console.Write(job[i]);//打印职位是个坑
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印职位
}
Console.Write(job[i]);//打印职位是个坑
2016-10-25