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]+",");
}
2016-12-08
int x = 2;
do
{
x++;
Console.Write(x+" ");
}
while(x>1&&x<=4);
}
}
do
{
x++;
Console.Write(x+" ");
}
while(x>1&&x<=4);
}
}
2016-12-08
if(money<10000){
if(money>=100000){
Console.LineWrite("送一台微波炉");
}else if(mobey<100000&&mobey>=50000){
Console.LineWrite("送一套茶具");
}else{
Console.LineWrite("送一袋大米");
}
}else
Console.LineWrite("没有礼品");
if(money>=100000){
Console.LineWrite("送一台微波炉");
}else if(mobey<100000&&mobey>=50000){
Console.LineWrite("送一套茶具");
}else{
Console.LineWrite("送一袋大米");
}
}else
Console.LineWrite("没有礼品");
class Program
{
static void Main(string[] args)
{
Console.WriteLine(true);//输出True
Console.WriteLine( false);//输出False
Console.WriteLine(true);//输出True
}
}
}
{
static void Main(string[] args)
{
Console.WriteLine(true);//输出True
Console.WriteLine( false);//输出False
Console.WriteLine(true);//输出True
}
}
}
2016-12-08
string boy = "秀丽";//男孩名字
string girl = "伟强";//女孩名字
string temp;//中间变量
tepm=boy;//把男孩的名字赋值给temp
boy=girl;//把女孩的名字赋值给男孩
girl=tepm;//把temp中的名字赋值给女孩
Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
扯淡
string girl = "伟强";//女孩名字
string temp;//中间变量
tepm=boy;//把男孩的名字赋值给temp
boy=girl;//把女孩的名字赋值给男孩
girl=tepm;//把temp中的名字赋值给女孩
Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
扯淡
2016-12-08
if (x>=y)
{
if(x>=5)
Console.WriteLine ("5")
}
感觉这像是在说
bool x>=y&&x>=5
Console.WriteLine ("5")
{
if(x>=5)
Console.WriteLine ("5")
}
感觉这像是在说
bool x>=y&&x>=5
Console.WriteLine ("5")
2016-12-07
string[] name=new string[]{"吴松","};
int[] score=new int[]{"89","90","98","56","60","91","93","85"};
int index=0; int max=score[0]; for(int i=0;i<score.Length;i++) { if(score[i]>max) max=score[i]; index=i;} Console.Write("分数最高的是{0},数是{1}",name[index],score[index]);
int[] score=new int[]{"89","90","98","56","60","91","93","85"};
int index=0; int max=score[0]; for(int i=0;i<score.Length;i++) { if(score[i]>max) max=score[i]; index=i;} Console.Write("分数最高的是{0},数是{1}",name[index],score[index]);
double money = 60000.00;//存款金额
if (money >= 100000)//请在这里补充多重条件判断
Console.WriteLine("送一台微波炉");
else if (money >= 50000 && money < 100000)
Console.WriteLine("送一套茶具");
else if (money >= 10000 && money < 50000)
Console.WriteLine("送一袋大米");
else
Console.WriteLine("没有礼品");
if (money >= 100000)//请在这里补充多重条件判断
Console.WriteLine("送一台微波炉");
else if (money >= 50000 && money < 100000)
Console.WriteLine("送一套茶具");
else if (money >= 10000 && money < 50000)
Console.WriteLine("送一袋大米");
else
Console.WriteLine("没有礼品");