为什么我的代码和答案一样并且在vs中是可以的 但是在这却不行!! 这样不通过 我的这门课程就因为这一节而无法完成!!!!!!!
2016-10-28
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;
已采纳回答 / 小小1七爷
using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { for (int x = 1; x < 10; x++) { if(x==3||x==8) ...
2016-10-28
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+"的典范");//使用常量
}
}
}