int x = 2;
do
{
x++;
Console.Write(x+" ");
}
while(x>2&&x<=4);
}
do
{
x++;
Console.Write(x+" ");
}
while(x>2&&x<=4);
}
2017-08-29
for (int x=0; x<=12;x++ )//请填写代码
{
Console.WriteLine(x+" ");
}
{
Console.WriteLine(x+" ");
}
2017-08-29
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);
}
2017-08-29
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;
}不要谢我
2017-08-29
static void Main(string[] args)
{
string boy = "秀丽";//男孩名字
string girl = "伟强";//女孩名字
boy=boy+girl;
girl=boy-girl;
boy=boy-girl;
Console.WriteLine("男孩叫" + boy + " 女孩叫" + girl);
}
{
string boy = "秀丽";//男孩名字
string girl = "伟强";//女孩名字
boy=boy+girl;
girl=boy-girl;
boy=boy-girl;
Console.WriteLine("男孩叫" + boy + " 女孩叫" + girl);
}
2017-08-28
bool theKey = false;
foreach(int i in num){
if(i % 7 == 0) {
theKey = true;
break;
}
}
string s = theKey ? "有" : "没有";
Console.Write("{0}7的整倍数",s);
foreach(int i in num){
if(i % 7 == 0) {
theKey = true;
break;
}
}
string s = theKey ? "有" : "没有";
Console.Write("{0}7的整倍数",s);
string[] names = {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};int[] scores = {89, 90, 98,56,60,91,93,85};int mark=0; int temp = scores[0];for(int i=0;i<scores.Length;i++){if(temp<scores[i]){temp = scores[i];mark = i;}
}Console.WriteLine("分数最高的是"+names[mark]+",分数是"+scores[mark]);
}Console.WriteLine("分数最高的是"+names[mark]+",分数是"+scores[mark]);