{
for (int A = 1; A < 8; A++) {
for (int B = 1; B < 8; B++)
if (A == B || A == 8 - B)
Console.Write ("O");
else {
Console.Write (".");
}
Console.WriteLine ("");
}
}
}
}
for (int A = 1; A < 8; A++) {
for (int B = 1; B < 8; B++)
if (A == B || A == 8 - B)
Console.Write ("O");
else {
Console.Write (".");
}
Console.WriteLine ("");
}
}
}
}
string[,] a = 二维数组 int max = 0; for (int i = 0; i < a.GetLength(0); i++)
{if (int.Parse(a[i, 1]) > max) {
max = int.Parse(a[i, 1]); } } for (int x = 0; x < a.GetLength(0); x++){ if (int.Parse(a[x, 1]) == max) { Console.WriteLine("分数最高的是{0},分数是{1}", a[x, 0], max); break; } }
{if (int.Parse(a[i, 1]) > max) {
max = int.Parse(a[i, 1]); } } for (int x = 0; x < a.GetLength(0); x++){ if (int.Parse(a[x, 1]) == max) { Console.WriteLine("分数最高的是{0},分数是{1}", a[x, 0], max); break; } }
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(String[]args)
{
Console.WriteLine("今日事,今日毕。");
}
}
}
这样就可以,把class和static前面空格至最前,我交了可以了
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(String[]args)
{
Console.WriteLine("今日事,今日毕。");
}
}
}
这样就可以,把class和static前面空格至最前,我交了可以了
2017-06-26
提交也没报错,但是vs运行是一片空白
static void Main(string[] args)
{
for (int y = 1; y <= 7; y++)
{
for (int x = 7; x<=1; x--)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
static void Main(string[] args)
{
for (int y = 1; y <= 7; y++)
{
for (int x = 7; x<=1; x--)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
2017-06-26
if (x >= y)
if (x >= 5)
Console.WriteLine("6");
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("6");
if (x >= 5)
Console.WriteLine("6");
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("6");
2017-06-26
已采纳回答 / 一念征途
你好,有时会因为网络繁忙等原因,代码会提交不上,可以隔断时间再提交试试,多提交几次就可以了。如果需要检查下你的代码正不正确,可以安装个visual studio(简称VS),在visual studio上运行看下结果。祝你学习顺利!
2017-06-26
最赞回答 / 一念征途
你好,C# 关键字主要分为:类型,修饰符,语句关键字,方法参数,命名空间关键字,运算符关键字,转换关键字,访问关键字,文本关键字,上下文关键字,查询关键字。而这里面没有包含“Main”,所以它不是关键字。如果需要了解更多的关键字的话 ,可以看下这个网址:https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/types 个人感觉在实际代码中,如果不确定某个单词是不是关键字,你可以换个其他的单词进行命名...
2017-06-26