string[,] sc = { {"吴松","89" }, {"钱东宇","90" }, { "伏晨","98"}, {"陈陆","56" }, {"周蕊","60" }, {"林日鹏","91" }, {"何昆","93" }, {"关欣","85" } };int scoreMax=int.Parse(sc[0,1]); int x=0;for(int i=0;i<sc.GetLongLength(0);i++){if (int.Parse(sc[i,1]) > scoreMax){scoreMax =int.Parse (sc[i,1])};x=i;Console.Write{省略}
int x = 1;
int sum = 0;//和,初始化为0
while (x <= 30)//循环条件
{
if ((x+1)%2==0)//筛选条件
sum += x;
x++;
}
Console.Write("1-30奇数的和:"+sum);
int sum = 0;//和,初始化为0
while (x <= 30)//循环条件
{
if ((x+1)%2==0)//筛选条件
sum += x;
x++;
}
Console.Write("1-30奇数的和:"+sum);
2016-06-05
已采纳回答 / 杭州313125
namespace Test{ class Program { static void Main(string[] args) { for (int x=1;x<=7;x++)//请完善代码 { for (int y=1;y<=7;y++) { if (x==y||x+y==8) ...
2016-06-04
最新回答 / 君遥
你是想实现键盘输入五个同学的姓名和成绩存在两个一维数组里面首先你的写法有问题,score[i] = Console.ReadLine("第{0}个同学的分数是{1}",i,score[i]);name[i] = Console.ReadLine("第{0}个同学的姓名是{1}",i,name[i]);把这两行代码修改一下就好了,ReadLIne是接受键盘输入的,所以里面的参数是不能要的,应该修改为 Console.WriteLine("请输入第{0}位同学的姓名:", i+1...
2016-06-04
int x=1;
bool a = ++x * x > 3;
bool b = true;//请赋值
Console.WriteLine(a==b);
bool a = ++x * x > 3;
bool b = true;//请赋值
Console.WriteLine(a==b);
2016-06-03
//声明整型数组,保存一组整数
int[] num = new int[] { 3, 34, 42, 2, 11, 19, 30, 55, 20 };
//请完善代码,循环打印数组中的偶数
for (int a = 0; a < num.Length; a++)//定义整数类型变量a, a小于数组num个数,a=a+1自增
{
if (num[a] % 2 == 0)//判断数组num[a]余2是否等于0
{
Console.Write(num[a] + ",");//是则输出该数组,否则完成判断进入下一次循环
去掉部分代码是因为回复字数有限制
int[] num = new int[] { 3, 34, 42, 2, 11, 19, 30, 55, 20 };
//请完善代码,循环打印数组中的偶数
for (int a = 0; a < num.Length; a++)//定义整数类型变量a, a小于数组num个数,a=a+1自增
{
if (num[a] % 2 == 0)//判断数组num[a]余2是否等于0
{
Console.Write(num[a] + ",");//是则输出该数组,否则完成判断进入下一次循环
去掉部分代码是因为回复字数有限制
for (int i = 0; i < score.Length; i++)
{
if (score[i] > max)
{
Console.Write(name[i] + " ");
}
}
{
if (score[i] > max)
{
Console.Write(name[i] + " ");
}
}
int sum = 0, avg;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.Write("平均分是{0},", avg);
int max = avg;
Console.WriteLine("高于平均分的有:");
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.Write("平均分是{0},", avg);
int max = avg;
Console.WriteLine("高于平均分的有:");