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(".");
}
}
}
最赞回答 / Gaohay
using System; using System.Collections.Generic; using System.Text; namespace sushu {
class Program
{
static void Main(string[] args)
{
int m, n, i, t;
Console.WriteLine("请输入第一个整数:");
...
2017-01-31
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
在内层加一行else;就OK,目的是使原本的else与上面那个匹配,那么只要弄个else;与第二个匹配就行,;是因为不需要执行块
if (x >= y)
if (x >= 5)
Console.WriteLine("5");
else;
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
if (x >= y)
if (x >= 5)
Console.WriteLine("5");
else;
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
2017-01-30
int[] num = {89,90,98,56,60,91,93,85};
string[] y = { "吴松","钱东宇","伏晨","陈路","周蕊","林日鹏","何昆","关欣" }
int max = num[0];
int index = 0;
for(int i = 0; i < num.GetLength(0); i++)
if(max < num[i])
max = num[i];
index = i;
int dex = 0;
for (int q = 0; q < y.GetLength(0); q++)
dex = q;
if (index == dex)
自己排下
string[] y = { "吴松","钱东宇","伏晨","陈路","周蕊","林日鹏","何昆","关欣" }
int max = num[0];
int index = 0;
for(int i = 0; i < num.GetLength(0); i++)
if(max < num[i])
max = num[i];
index = i;
int dex = 0;
for (int q = 0; q < y.GetLength(0); q++)
dex = q;
if (index == dex)
自己排下