stone031211 2017-12-08 00:44 采纳率: 0%
浏览 784

求大神来帮助C#,怎么修改

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{

class Student
{
    public static int sno=0;
    string sname;
    char cno;
    float score;

    public void SetName(string name)
    {
        sname = name;
    }
    public string Sno { get; set; }
    public string Sname { get; set; }
    public string Cno { get; set; }
    public float Score { get; set; }
    public Student(string sno,string sname,string cno,float score)
    {
        this.Sno = sno;
        this.Sname = sname;
        this.Cno = cno;
        this.Score = score;
    }

}

class Control
{
    public void Login()
    {
    }
    public void StudentMenu()
    {

    }
    public void TeacherMenu()
    {

    }
    public void Exit()
    {

    }
}
class Operating
{
    public void Student()
    {

    }

    public void AddStudent(Student s)
    {
        Console.WriteLine("Name:");
        string n = Console.ReadLine();
        s.SetName(n);
        Student.SortStudentByNo++;

    }

    void DellStudent(Student[] a,int pos)
    {

    }
    void ModStudent(Student[] a, int pos)
    {

    }
    void SortStudentByNo(Student[] a)
    {
        int i, j, temp;
        for(i=0;i<a.Length;i++)
        {
            for(j=i;j<a.Length-i-1;j++)
            {
                if(a[j].sno>a[j+1].sno)
                {

                }
            }
        }
    }
    public void FindStudent(Student[] a, string name)
    {
        int i;
        for(i=0;i<a.Length;i++)
        {
            if(a[i].Sname==name)
            {
                Console.WriteLine("找到{0}同学", name);
                break;
            }
        }
        if(i==a.Length)
        {
            Console.WriteLine("没有找到{0}同学", name);
        }
    }
    /*
    void StaScore(Student a[])
    {

    }*/
}
class Program
{

    static void Main(string[] args)
    {
        Console.WriteLine("************************");
        DateTime.Now.ToString();
        Console.WriteLine("************************");;
        const int MAX = 500;
        Student[] s = new Student[MAX];
        Control cc = new Control();
        cc.Login();
        Operating oo = new Operating();
        oo.AddStudent(a[Student.sno]);

     }
}

}

  • 写回答

1条回答

  • A_huaer 2017-12-08 02:41
    关注

    我在你的Student里面都没有找到SortStudentByNo..... 你是怎么++的....

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料