Python
changdu = int(input("请输入一条路的长度")) jvli = int(input("请输入多少米种一棵树")) liangduan = int(input("路的两端种不种数(1=种,2=不种)")) if changdu%jvli==0: if liangduan==1: shumu=changdu/jvli+1 print(int(shumu)) else: shumu = changdu / jvli - 1 print(int(shumu)) else: print("数据错误")