static void Main(string[] args)
{
int x;//循环计数变量
x=0;//行① 请填写计数变量的初始化语句
while (x<5)//行② 请填写循环条件
{
Console.Write("加油!");
++;//行③ 请填写计数变量的自加语句
}
}
{
int x;//循环计数变量
x=0;//行① 请填写计数变量的初始化语句
while (x<5)//行② 请填写循环条件
{
Console.Write("加油!");
++;//行③ 请填写计数变量的自加语句
}
}
namespace Test
{
class Program
{
static void Main(string[] args)
{
int y = 5;
while (y!=0)//请输入
{
Console.Write(y+" ");
y--;//请输入
}
}
}
}
{
class Program
{
static void Main(string[] args)
{
int y = 5;
while (y!=0)//请输入
{
Console.Write(y+" ");
y--;//请输入
}
}
}
}
2018-04-09
任务下面不会了怎么办
输出的是 x-y 的值,已经知道 x 的初始值为 2 , x/=0.5 以后 x 变成 4 ,只要让 y 也变成 4 ,结果就是 0 了。
y 的初始值是 2 , y*=2 或者 y+=2 都能达到目的。
什么鬼
输出的是 x-y 的值,已经知道 x 的初始值为 2 , x/=0.5 以后 x 变成 4 ,只要让 y 也变成 4 ,结果就是 0 了。
y 的初始值是 2 , y*=2 或者 y+=2 都能达到目的。
什么鬼
2018-04-07
亲测,在整数相除,结果仅保留整数部分这一点上,python、c、java、c++语言和C#一样的,PHP是弱类型语言,PHP会输出0.5而非0;
强类型语言,整数除整数,结果还是整数,而弱类型语言和它们不一样。
不知道评论下面为什么会有人说C#规范者有毛病 ←_←
强类型语言,整数除整数,结果还是整数,而弱类型语言和它们不一样。
不知道评论下面为什么会有人说C#规范者有毛病 ←_←
2018-04-07
string topName; int topScore = 0;
Dictionary<string,int> l = new Dictionary<string,int>();
l.Add("吴松",89);l.Add("钱东宇",90);//后面的几个人忽略了不然太长
foreach(KeyValuePair<string, int> kv in l)
if(kv.Value>topScore){ topName = kv.Key; topScore = kv.Value; }
Console.WriteLine("分数最高的是{0},分数是{1}",topName,topScore);
Dictionary<string,int> l = new Dictionary<string,int>();
l.Add("吴松",89);l.Add("钱东宇",90);//后面的几个人忽略了不然太长
foreach(KeyValuePair<string, int> kv in l)
if(kv.Value>topScore){ topName = kv.Key; topScore = kv.Value; }
Console.WriteLine("分数最高的是{0},分数是{1}",topName,topScore);