string[] a = { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
int[] b = { 90,65,88,70,46,81,100,68 };
avg = sum / a.Length;
Console.WriteLine("平均分是{0},高于平均分的有:",avg);
for (int j = 0; j < b.Length; j++)
{
if (b[j] > avg)
{
Console.Write(a[j] + " ");
}
}
int[] b = { 90,65,88,70,46,81,100,68 };
avg = sum / a.Length;
Console.WriteLine("平均分是{0},高于平均分的有:",avg);
for (int j = 0; j < b.Length; j++)
{
if (b[j] > avg)
{
Console.Write(a[j] + " ");
}
}
char[,] ch = { {'我','是','软'},{'件','工','程'},{'师','啦','!'}};
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
2015-09-10
string[] t = new string[] { "C", "Sh", "a", "rp" };
foreach (string x in t)//遍历字符串数组t
{
Console.Write(x);
}
foreach (string x in t)//遍历字符串数组t
{
Console.Write(x);
}
2015-09-10
int[] score = new int[] { 89, 39, 100, 51, 94, 65, 70 };//分数
Console.Write("不及格的有:");
for (int i = 0; i < score.Length; i++)
{
if ( score[i]<60 )//筛选条件
Console.Write(score[i] + ",");
}
Console.Write("不及格的有:");
for (int i = 0; i < score.Length; i++)
{
if ( score[i]<60 )//筛选条件
Console.Write(score[i] + ",");
}
2015-09-10
string[] job = { "经理", "项目主管", "技术总监", "财务主管" };
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i]);
}
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i]);
}
2015-09-10