case"局长": Console.Write("发双黄月饼"); break;
case"处长": Console.Write("发蛋黄月饼"); break;
case"科长": Console.Write("发枣泥月饼"); break;
错误--单词 !defualt: Console.Write("发五仁月饼"); break;
case"处长": Console.Write("发蛋黄月饼"); break;
case"科长": Console.Write("发枣泥月饼"); break;
错误--单词 !defualt: Console.Write("发五仁月饼"); break;
2017-02-06
成绩这个例子可以把for换成foreach吗?
foreach(int x in score)
{
Console.WriteLine("怎么写啊就一个x好像只适用于一维");
}
加个y?
foreach(int xy in score)
{
Console.WriteLine("奇葩");
}
foreach(int x in score)
{
Console.WriteLine("怎么写啊就一个x好像只适用于一维");
}
加个y?
foreach(int xy in score)
{
Console.WriteLine("奇葩");
}
2017-02-06
string[] wuhushangjiang={"关羽","张飞","赵云","马超","黄忠"};//请在这里完善代码
for(int i=0;i<wuhushangjiang.Length;i++)
Console.Write(wuhushangjiang[i]+",");
for(int i=0;i<wuhushangjiang.Length;i++)
Console.Write(wuhushangjiang[i]+",");
string[] names = new string[]{"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[] score = new int[]{90,65,88,70,46,81,100,68};
int sum = 0;
int avg = 0;
foreach(int i in score){
sum = sum+i;
}
avg=sum/8;
int[] score = new int[]{90,65,88,70,46,81,100,68};
int sum = 0;
int avg = 0;
foreach(int i in score){
sum = sum+i;
}
avg=sum/8;
//请完善代码
for(int x=0;x<7;x++){
for(int y=0;y<7;y++){
if(y==x||(x+y)==6){
Console.Write("o");
}else{
Console.Write(".");
}
}
}
for(int x=0;x<7;x++){
for(int y=0;y<7;y++){
if(y==x||(x+y)==6){
Console.Write("o");
}else{
Console.Write(".");
}
}
}
namespace Test
{
class Program
{
static void Main(string[] args)
{
for (int x = 1; x < 10; x++)
{
if(x!=3&&x!=8)//请添加代码,过滤3和8
Console.Write(x);
}
}
}
}
{
class Program
{
static void Main(string[] args)
{
for (int x = 1; x < 10; x++)
{
if(x!=3&&x!=8)//请添加代码,过滤3和8
Console.Write(x);
}
}
}
}
2017-01-31