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-05-21
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-05-21
已采纳回答 / 一念征途
你好,char是单字符类型,可以存储一个汉字,或者一个数字,或者一个字母,比如 char a = 'a'; 如果 char a = 'ab'; 这样的话就会报错,提示“字符文本中的字符过长’。在实际项目中,通常把性别设置为char类型,用来存储‘男’或者‘女’,还有就是类型代码:例如 声明一个变量state,统一规定:0表示小学生,1代表初中生,2代表高中生,3代表大学生。这样state的值的范围是0,1,2,3,4,这是往往把state设置为char型。概况的说,如果确定某个变量的取值只是个单字符,那...
2017-05-21
if(salary>price)//请在这里补充条件判断
{
Console.WriteLine("这月工资够买手机!");
}
else
{
Console.WriteLine("这月工资不够买手机!");
}
}
}
{
Console.WriteLine("这月工资够买手机!");
}
else
{
Console.WriteLine("这月工资不够买手机!");
}
}
}
string[,] name = { { "吴松", "89" }, { "钱东宇", "90" }, { "伏晨", "98" } };
int max = 0;
int m = 0;
for (int i = 0; i < name.GetLength(0); i++)
{
int n;
n = Convert.ToInt32(name[i, 1]);
if (n > max)
{
max = n;
m = i;
}
}
Console.WriteLine("最高是{0},分数为{1}",max,name[m,0]);
int max = 0;
int m = 0;
for (int i = 0; i < name.GetLength(0); i++)
{
int n;
n = Convert.ToInt32(name[i, 1]);
if (n > max)
{
max = n;
m = i;
}
}
Console.WriteLine("最高是{0},分数为{1}",max,name[m,0]);
string[,] name = { { "吴松", "89" }, { "钱东宇", "90" }, { "伏晨", "98" } };
int max = 0;
int m = 0;
for (int i = 0; i < name.GetLength(0); i++)
{
int n;
n = Convert.ToInt32(name[i, 1]);
if (n > max)
{
max = n;
m = i;
}
}
Console.WriteLine("最高是{0},分数为{1}",max,name[m,0]);
int max = 0;
int m = 0;
for (int i = 0; i < name.GetLength(0); i++)
{
int n;
n = Convert.ToInt32(name[i, 1]);
if (n > max)
{
max = n;
m = i;
}
}
Console.WriteLine("最高是{0},分数为{1}",max,name[m,0]);
2017-05-19
最新回答 / 来来lan
namespace csharp{ class Program { static void Main(string[] args) { int i,avg,sum=0; string[,] a = new string[8, 2] { {"景珍","90"}, {"林慧洋","65" }, { "成蓉","88"}, { "洪南昌","70"}, {"龙玉民","46" }, {"单开江","81" }, {"田武山","...
2017-05-19
已采纳回答 / qq_友人A_15
age[]应该是一个int类型数组,输出时前面要加{0},{1},{2},{3},然后再加上age[0],age[1],age[2],age[3]. 如果直接用age[0],age[1],age[2],age[3]是默认string类型
2017-05-19
int x=1;
bool a = ++x * x > 3;
bool b =true ;//请赋值
Console.WriteLine(a==b);
a的值是4,4大于3,所以得到true
bool a = ++x * x > 3;
bool b =true ;//请赋值
Console.WriteLine(a==b);
a的值是4,4大于3,所以得到true
2017-05-19
最赞回答 / 一念征途
你好,text=year/4!=0?"平年":"闰年"; 与 text=year%4==0?"闰年":"平年";这2个代码的运行结果是一样的,都是正确的。不过在慕课网上的课堂练习中,有些正确的答案提交时,可能会提示错误,个人感觉因为一些程序会有好几种正确写法,慕课网的后台验证时,只是验证了一种或者几种的写法,并没有把所有的正确代码都验证一遍。如果希望多种代码都验证的话,可以安装个visual studio,在visual studio上运行代码。如果还有不懂得地方,可以继续回复我。如果觉得回答还不错的...
2017-05-18
最新回答 / Kazami
按一般的来说就是,用VS连接SQL数据库来写,插入比较简单脱几个textbox来当输入的参数就行,然后用一个button的单击事件来进行。删除和更新记录的话,可以用 <...code...>这句话的意思就是获取用户选中的单元格的值,这个可以作为删除条件或者是修改的条件。
2017-05-18