public static void OutData(int Tot) { string File_Menu = Path_Menu.path + "小金同学失恋了"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int kk = 1; while (Tot-- > 0) { string path = File_Menu + "\\" + kk.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int a = rd.Next(0, 10), b = rd.Next(0, 10); Inn.WriteLine(a + " " + b); int n = rd.Next(3, 40); Inn.WriteLine(n); Out.WriteLine(Ans(a, b, n)); Console.WriteLine("File " + kk++ + " made ok!!!"); Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); } }
public static void OutData(int Tot, int MaxArrlen) { string File_Menu = Path_Menu.path + "小金同学的偶遇"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int kk = 1; while (Tot-- > 0) { string path = File_Menu + "\\" + kk.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int T = rd.Next(5, MaxArrlen); ArrayList arr = new ArrayList(); for (int i = 0; i < T; i++) { int a; do { a = rd.Next(-MaxArrlen, MaxArrlen); } while (a == -1); Inn.WriteLine(a); arr.Insert(0, a); } string str = "-1"; Inn.Write(str); Out.WriteLine(ans(arr)); Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); Console.WriteLine("File " + kk++ + " made ok!!!"); } }
public static void OutData(int Tot, int MaxT, int MaxValue) { string File_Menu = Path_Menu.path + "小金同学自闭了"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int kk = 1; while (Tot-- > 0) { string path = File_Menu + "\\" + kk.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int T = rd.Next(1, MaxT); Inn.WriteLine(T); while (T-- > 0) { int n = rd.Next(2, MaxValue); Inn.WriteLine(n); Out.WriteLine(Ans(n)); } Console.WriteLine("File " + kk++ + " made ok!!!"); Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); } }
public static void OutData(int Tot, int T_MaxLength, int Str_MaxLength) { string File_Menu = Path_Menu.path + "小金同学写情书"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int kk = 1; while (Tot-- > 0) { string path = File_Menu + "\\" + kk.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int T = rd.Next(1, T_MaxLength); Inn.WriteLine(T); while (T-- > 0) { StringBuilder str = new StringBuilder(); bool[] book = new bool[Str_MaxLength + 5]; int len = rd.Next(3, Str_MaxLength); for (int i = 0; i < Str_MaxLength + 5; i++) { book[i] = true; } for (int i = 0; i < len; i++) { int a = 97 + rd.Next(0, 26); str.Append(Convert.ToChar(a)); } Inn.WriteLine(str); int bb = rd.Next(0, 26) + 97, cc = rd.Next(0, 26) + 97; char bbb = Convert.ToChar(bb); char ccc = Convert.ToChar(cc); Inn.WriteLine(bbb + "" + ccc); for (int i = 0; i < str.Length - 1; i++) { if (bbb == str[i] && ccc == str[i + 1]) { book[i] = false; book[i + 1] = false; } } for (int i = 0; i < str.Length; i++) { if (book[i]) { Out.Write(str[i]); } } Out.WriteLine(); } Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); Console.WriteLine("File " + kk++ + " made ok!!!"); } }
public static void OutData(int Tot, int MaxT) { string File_Menu = Path_Menu.path + "小金同学爱烫头"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int mm = 1; while (Tot-- > 0) { string path = File_Menu + "\\" + mm.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int T = rd.Next(1, MaxT); Inn.WriteLine(T); while (T-- > 0) { int n = rd.Next(0, 201); Inn.WriteLine(n); if (n >= 119) { Out.WriteLine("WenLiTang"); } else if (n >= 89) { Out.WriteLine("YangMaoJuan"); } else if (n >= 69) { Out.WriteLine("XiZhiTang"); } else { Out.WriteLine("None"); } } Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); Console.WriteLine("File " + mm++ + " made ok!!!"); } }
public static void OutData() { DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); string path = Path_Menu.path + "//" + "maze.txt"; StreamReader sr = new StreamReader(path); string temp; int nn = 0, mm = 0; while ((temp = sr.ReadLine()) != null) { mm = 0; if (temp[0] == '3') { continue; } else { for (int i = 0; i < temp.Length; i++) { maze[nn, mm++] = temp[i]; } for (int i = 0; i < temp.Length; i++) { Console.Write(maze[nn, i]); } Console.WriteLine(); nn++; } } sr.Close(); Console.WriteLine("文件 maze.txt 读入到二维字符数组成功!!!\n\n下面开始走迷宫!那将会很快乐!"); solve(); }
public static void OutData(int Tot, int T_MaxLength) { string File_Menu = Path_Menu.path + "小金同学去约会"; DirectoryInfo dir = new DirectoryInfo(File_Menu); dir.Create(); Path_Menu.O(dir); int kk = 1; while ((Tot--) > 0) { string path = File_Menu + "\\" + kk.ToString(); StreamWriter Inn = new StreamWriter(path + ".in"); StreamWriter Out = new StreamWriter(path + ".out"); Random rd = new Random((int)(DateTime.Now.Ticks)); int T = rd.Next(1, T_MaxLength); Inn.WriteLine(T); while ((T--) > 0) { int n, m; n = rd.Next(1, 61); m = rd.Next(1, 61); Inn.WriteLine(n + " " + m); if (Ans(n, m)) { Out.WriteLine("Succeed!!!"); } else { Out.WriteLine("Separate!!!"); } } Console.WriteLine("File " + kk++ + " made ok!!"); Inn.Close(); Out.Close(); Inn.Dispose(); Out.Dispose(); } }