Professional Documents
Culture Documents
Sinhvien: "Nhap Ten SV: " "Nhap Ma SV: "
Sinhvien: "Nhap Ten SV: " "Nhap Ma SV: "
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp18
{
public abstract class SinhVien
{
private string tenSV;
private string maSV;
namespace ConsoleApp18
{
public class SoHuuTi
{
private double a;
private double b;
public SoHuuTi() { }
public SoHuuTi(double a, double b)
{
this.a = a;
this.b = b;
}
namespace ConsoleApp18
{
public class MyIntArray
{
private int[] a;
//private int n;
public MyIntArray() { }
public MyIntArray(int[] a)
{
this.a = a;
}
public void NhapMang()
{
//Console.Write("Nhap so phan tu: ");
//n = int.Parse(Console.ReadLine());
Console.Write("Nhap array: ");
string[] s = Console.ReadLine().Split();
a = new int[s.Length];
for (int i=0; i<s.Length; i++)
{
a[i] = int.Parse(s[i]);
}
}
public void XuatMang()
{
for (int i=0; i<a.Length; i++)
{
Console.Write(a[i] + " ");
}
}
}
}
Bài 4:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApp18
{
public class MyArray
{
private ArrayList a;
public MyArray() { }
public MyArray(ArrayList a)
{
this.a = a;
}
public void ThemPT(object s)
{
a.Add(s);
}
}
}