2个回答
展开全部
class Program
{
static Random ran = new Random();
static void Main(string[] args)
{
int[] array = RandomArray();
int min, max;
FindMaxMin(array, out min, out max);
Console.WriteLine("Max={0} Min={1}", max, min);
int oddEnd = 100;
int sum = OddSum(oddEnd);
Console.WriteLine("Sum={0}", sum);
int read = int.Parse(Console.ReadLine());
bool oddeven = OddEven(read);
Console.WriteLine("{0}数", read <= 0 ? "自然" : (oddeven ? "偶" : "奇"));
int factorial = 8;
Console.WriteLine("{0}!={1}", factorial, Factorial(factorial));
int even5 = int.Parse(Console.ReadLine());
Console.WriteLine("{0}{1}{2}的倍数", even5, Multiple(even5, 5) ? "是" : "不是", 5);
Console.ReadKey();
}
private static bool Multiple(int ori, int mul)
{
return ori % mul == 0;
}
private static long Factorial(int factorial)
{
if (factorial == 1) return factorial;
return factorial * Factorial(factorial - 1);
}
private static bool OddEven(int read)
{
return read % 2 == 0;
}
private static int OddSum(int oddEnd)
{
int sum = 0;
for (int i = 1; i < oddEnd; i += 2)
{
sum += i;
}
return sum;
}
private static void FindMaxMin(int[] array, out int min, out int max)
{
max = int.MinValue; min = int.MaxValue;
for (int i = 0; i < array.Length; i++)
{
int non = array[i];
if (non < min) min = non;
if (non > max) max = non;
}
}
static int[] RandomArray()
{
int length = ran.Next(8, 16);
int[] array = new int[length];
for (int i = 0; i < length; i++)
{
array[i] = ran.Next(2, 128);
}
return array;
}
}
更多追问追答
追问
这是第几问。。
readkey结束后面的是?
2016-01-09
展开全部
}
RequestBody requestBody = builder.build();
return new Request.Builder()
.url(url)
.post(requestBody)
.build();
}
RequestBody requestBody = builder.build();
return new Request.Builder()
.url(url)
.post(requestBody)
.build();
}
追问
你在逗我
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询