import sys def hanoi(n, a, b, c): if n == 1: print(‘%c --> %c‘ % (a, c)) else: hanoi(n-1, a, c, b) print(‘%c --> %c‘ % (a, c)) hanoi(n-1, b, a, c) if __name__ == "__main__": n = int(sys.stdin.readline()) hanoi(n, ‘A‘, ‘B‘, ‘C‘)
using System.Diagnostics; namespace Hanoi { class Program { static void Main(string[] args) { Process process = new Process { StartInfo = new ProcessStartInfo { FileName = "python", Arguments = "hanoi.py", UseShellExecute = false } }; process.Start(); process.WaitForExit(); } } }
原文地址:https://www.cnblogs.com/JebediahKerman/p/Process_Class_System_Diagnostics.html
时间: 2025-01-01 08:56:07