C#2022/11/9

            //Print print = new Print();
            //int i = 0;                                         //判断输入是数字/字符串;未解之谜 存入数组时数据产生误差
            //string str = Console.ReadLine();
            //if (str.All(char.IsDigit))
            //{
            //    int[] array = new int[str.Length];
            //    for (int j = 0; j < str.Length; j++)
            //    {
            //        Console.WriteLine(str[j]);
            //        Console.WriteLine(str[j].GetType());
            //        Console.WriteLine(Convert.ToInt32(str[j]).GetType());
            //        array[j] = Convert.ToInt32(str[j] - 48);    //Convert.ToInt32(str[j]-48) 存入数组时数据产生误差48;
            //        Console.WriteLine(array[j]);

            //    }
            //    print.sort(array);
            //}
            //else
            //{
            //    print.sort(str);
            //}

 //User user = new User("showmaker","123456",12315);     //用户类构造函数初始化信息输出;

            //Person person = new Person();                           //封装属性通过set,get方法调用私有成员;
            //person.Age = int.Parse(Console.ReadLine());    

    //class Print
    //{
    //    public void sort(int[] array)
    //    {
    //        for (int i = 0; i < array.Length - 1; i++)
    //        {
    //            for (int j = i + 1; j < array.Length; j++)
    //            {
    //                if (array[i] > array[j])
    //                {
    //                    int temp = array[j];
    //                    array[j] = array[i];
    //                    array[i] = temp;
    //                }
    //            }
    //        }
    //        foreach (var item in array)
    //        {
    //            Console.Write(item + " ");
    //        }
    //    }
    //    public void sort(string str)
    //    {
    //        for (int i = str.Length - 1; i >= 0; i--)
    //        {
    //            Console.Write(str[i] + " ");
    //        }
    //    }
    //}

//class User
    //{
    //    private string userName;
    //    private string password;
    //    private int phone;
    //    public User(string userName,string password,int phone)
    //    {
    //        this.userName = userName;
    //        this.password = password;
    //        this.phone = phone;
    //        display();
    //    }
    //    public void display()
    //    {
    //        Console.WriteLine("用户名:{0} 密码:{1} 手机号码:{2}",userName,password,phone);
    //    }
    //}

 //class Person
    //{
    //    private int age;
    //    private int id;
    //    private string name;
    //    public int Id { get => id; set => id = value; }
    //    public int Age {
    //        get { return age; }
    //        set
    //        {
    //            if (value<0)
    //            {
    //                Console.WriteLine("年龄太小");
    //            }
    //            else
    //            {
    //                age = value;
    //                Console.WriteLine("年龄:{0}",age);
    //            }
    //        }
    //    }
    //    public string Name { get => name; set => name = value; }
    //}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值