结构型的数组的引用 C#

[复制链接]
查看11 | 回复4 | 2009-4-13 11:22:35 | 显示全部楼层 |阅读模式
定义一个学生成绩的结构,包含的成员有:学号(字符串型);学生该门课的成绩(浮点型)
编写C#程序,要求用户依次输入多个学生的成绩,将这些信息存储在一个结构型的数组里。在输入完成后,用户还可以通过输入学号,查询自己刚刚输入的对应于该学号的课程成绩。
注:我担心不能把问题阐述清楚就把题目发上来了,请各位给点思路,如果能给点代码,那就更好了.
lcg1986的代码偏离了主题,chanson007的代码更加完善,但不易理解,让你见笑了.
我真心的感谢各位的帮助,谢谢了!!

回复

使用道具 举报

千问 | 2009-4-13 11:22:35 | 显示全部楼层
为什么要用结构.奇怪.类多好啊.using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication8{
class Program
{
static void Main(string[] args)
{
StudentList list = new StudentList();
Student stu1 = new Student("00001",83);
Student ...
回复

使用道具 举报

千问 | 2009-4-13 11:22:35 | 显示全部楼层
本来我看到的时候 1个回复的都没有。结果忙了一会 。抢不到沙发了。。。给分吧。。。兄弟。。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace MyTest{
class Pr...
回复

使用道具 举报

千问 | 2009-4-13 11:22:35 | 显示全部楼层
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication3{
struct Student
{
public string stuNa...
回复

使用道具 举报

千问 | 2009-4-13 11:22:35 | 显示全部楼层
保存在arraylist 里...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行