Using system; namespace z1_jiu {class z1_jiu {public static void main () {string [] person; int personnum; initperson (Out person, out personnum); z1_jiu (person, personnum ); console. readkey ();} public static void initperson (out string [] person, out int personnum) {bool flag = true; personnum = 0; // check the number of students while (FLAG) {try {console. write ("Enter the number of people who want to capture the cursor:"); personnum = int. parse (console. readline (); flag = false;} catch {console. writeline ("enter a non-number, enter it again") ;}} person = new string [personnum]; // check that the name is not empty for (INT I = 0; I <personnum; I ++) {console. write ("enter the name of the {0} person:", I + 1); flag = true; while (FLAG) {person [I] = console. readline (); If (person [I] = "" | person [I] = NULL) console. write ("no name is entered. Please enter the name of the {0} person again:", I + 1); else flag = false ;}}} public static void z1_jiu (string [] person, int personnum) {console. writeline ("start to capture logs... "); system. random ran = new random (); For (INT I = 0; I <personnum; I ++) {// a random number that cannot exceed the length of the current array is generated at a time, the length of the array is reduced by 1 each time; int rannow = ran. next (personnum-I); console. writeline ("the result of the {0} capture is: {1}", I + 1, person [rannow]); // reduce the length of the array by 1 each time; delperson (ref person, rannow) ;}} public static void delperson (ref string [] person, int rannow) {string [] tempperson = new string [person. length-1]; // After the obtained random number, move one forward. For (INT I = rannow; I <(person. length-1); I ++) {person [I] = person [I + 1];} // reduce the array length by 1 each time; for (Int J = 0; j <person. length-1; j ++) {tempperson [J] = person [J] ;}person = tempperson ;}}}