Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
using System;
using System.Collections.Generic;
class student{
public string name, clas;
public int age;
public student(string n, string c, int a){
name = n;
clas = c;
age = a;
}
}
class studentManager{
private List<student> a = new List<student>();
public void getAllStudents(){
for (int i=0; i<a.Count; i++){
Console.WriteLine("{0}. {1} is a student of class {2}. He is {3} years old.",i+1,a[i].name,a[i].clas,a[i].age);
}
}
public void addStudent(string name, string clas, int age){
a.Add(new student(name, clas, age));
}
public void deleteStudent(int index){
a.RemoveAt(index-1);
}
public void searchStudent(string name){
for (int i=0; i<a.Count; i++){
if (a[i].name == name){
Console.WriteLine("{0}. {1} is a student of class {2}. He is {3} years old.",i+1,a[i].name,a[i].clas,a[i].age);
}
}
}
}
$\\$
`@Daoanhviet96`
Hãy giúp mọi người biết câu trả lời này thế nào?
Sự kiện
196
3442
149
Java căng thế :>
1395
25606
974
-.- C# mà
196
3442
149
oh nhầm :)) nhìn thấy hai cái đầu nhớ nhầm sang jv
196
3442
149
sao không ai làm python nhỉ có 23 dòng :)
1395
25606
974
java nó phải là: import java.util.ArrayList :)
196
3442
149
quên :)
1395
25606
974
sao không ai làm python nhỉ có 23 dòng :) C# 32 dòng (: