Static voidMain (string[] args) { int[,] CJ =New int[3, 4]; Console.WriteLine ("School number \ t language \ t math \ t Foreign language"); for(inti =0; I <3; i++) {Console.Write (i+1); Console.Write ("\ t"); strings =Console.ReadLine (); string[] str = s.split (' , ' \ t ', ', ');/////split (', ', ', ' ...) or split (', '), split (' \ t ') and many more can achieve the same goal.
The goal is to split the string into n strings;intyw = Convert.ToInt32 (str[0]); intSX = Convert.ToInt32 (str[1]); intWY = Convert.ToInt32 (str[2]); Console.WriteLine (yw+ SX +WY); } // string s = Console.ReadLine (); //int yw, SX, WY; //string[] str = s.split (', ', ', '-', ' \ t '); //yw = Convert.ToInt32 (str[0]); //SX = Convert.ToInt32 (str[1]); //WY = Convert.ToInt32 (str[2]); //Console.WriteLine ("Language: {0}, Mathematics: {1}, Foreign languages: {2}", YW, SX, WY);}
C # language-split split