最新回答 / X无法加载X
x++ 放在 sum += x 前面的话,就要满足 if 里的 x % 2 != 0 才能执行,而第一次循环 x=1,1除以2有余数,所以 x++ 就永远不会执行,就成了死循环
2018-05-10
string text;
text=((year%4==0&&year%100!=0)||(year%400==0))?"闰年":"平年";
text=((year%4==0&&year%100!=0)||(year%400==0))?"闰年":"平年";
2018-05-10
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(String []args)
{
Console.WriteLine("今日事,今日毕。");
}
}
}
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(String []args)
{
Console.WriteLine("今日事,今日毕。");
}
}
}
2018-05-09
好难受,刚学了java又来学c# 虽然都是面向对象, 但是格式大不同 就那main方法来说 一个是大写,一个是小写。好容易弄混
2018-05-08
int[] age = new int[4];//声明并初始化长度为4的整形数组
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
2018-05-08