用c#调用两个类随意输入三个数比较大小按顺序输出的代码
来源:百度知道 编辑:UC知道 时间:2024/06/27 18:28:44
谢谢各位高手!着急速度谢谢大家帮忙!
就是class类用两个class来完成这道题啊谢谢你啊
我这个随便输入几数的,从小到大排.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication29
{
class Program
{
static void Main(string[] args)
{
Console.Write("输入数:");
string[] s = Console.ReadLine().Split();
int len = s.Length;
int[] Int = new int[len];
for (int i = 0; i < s.Length; i++)
{
Int[i] = Convert.ToInt32(s[i]);
}
Array.Sort(Int);
foreach (int t in Int)
{
Console.Write(t + " ");
}
Console.ReadLine();
}
}
}
啊
static void Main(string[] args)
{
int[] a = new int[3];
for (int i = 0; i < a.Length; i++)
a[i]