for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
if(x==y)
continue;
}
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
if(x==y)
continue;
}
2017-06-28
最赞回答 / 一念征途
你可以用在“工具箱”选中“PasswordBox”控件,直接拖到mainwindow界面上,如果“工具箱”没有显示的话,可以在工具栏里找找,或者在菜单栏里点击“视图”,再点击“工具箱”,就会显示了。工...
2017-06-28
最赞回答 / 一念征途
你好,我们都在使用VS,sharpdevelop只听说过,并没使用过。不过建议还是安装个VS, VS 的普遍率比较高,很多课程和公司都用的是VS,哪怕现在可以不用VS,往后干这行的话,很有可能还是要安装VS。如果在安装过程中遇到什么问题,可以百度下或者提出来,看看大家能不能解决。如果VS真的安装不了的话,也可以安装个sharpdevelop试试,要是不好用的话,大不了再卸载了,程序员很多时候都得接触新事物。如果有帮到你,那就采纳下答案吧,祝你学习顺利!
2017-06-28
最赞回答 / 一念征途
你好,变量的话,“同时赋值” 和“分开赋值” 都是可以的。在C#开发轻松入门 2-6 的第一选择题中,题目是问的常量,常量是用const 进行修饰的,必须在声明是同时赋值,而且后续的不能修改,比如<...code...><...code...>
2017-06-27
最赞回答 / 一念征途
你好,第一种方法就是在加上一行暂停代码,在vs上运行时,可以在需要暂停的地方下 加上一行代码:<...code...>在输出时,会暂停下,按一下回车键,程序会继续运行,不过不推荐这种,推...
2017-06-27
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
这是最简单了吧
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
这是最简单了吧
2017-06-27
已采纳回答 / 一念征途
刚才复制了下你的代码,放到了编程练习中,提交不上去,把俩个括号重新以英文的输入法 敲了一遍,再提交就可以提交上去了。复制到vs中,也报 括号输入有误。你可以试下。输入时 注意中英文切换。<...code...>
2017-06-27
{
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