static void Main(string[] args)
{
int num1 = 5;//第一个加数
int num2 = 7;//第二个加数
int sum=num1+num2;//求和
Console.WriteLine("和是{0}",sum);//打印结果
}
{
int num1 = 5;//第一个加数
int num2 = 7;//第二个加数
int sum=num1+num2;//求和
Console.WriteLine("和是{0}",sum);//打印结果
}
2018-03-19
double d = 2.5;
int x = 2 + 1;
Console.WriteLine(x);
Program.cs(11,20): warning CS0219: The variable `d' is assigned but its value is never used
Compilation succeeded - 1 warning(s)
3
int x = 2 + 1;
Console.WriteLine(x);
Program.cs(11,20): warning CS0219: The variable `d' is assigned but its value is never used
Compilation succeeded - 1 warning(s)
3
2018-03-19
sum += score[i]; }
avg = sum/score.Length;
Console.Write("平均分是"+ avg + ",");
Console.WriteLine("高于平均分的有:");
for(int j = 0; j < name.Length; j++)
{
if(score[j] > avg)
Console.Write(name[j] + " ");
avg = sum/score.Length;
Console.Write("平均分是"+ avg + ",");
Console.WriteLine("高于平均分的有:");
for(int j = 0; j < name.Length; j++)
{
if(score[j] > avg)
Console.Write(name[j] + " ");