【发布时间】:2019-10-09 17:22:24
【问题描述】:
大家晚上好!我有这个愚蠢的问题,但我在语言手册中找不到解决方案。它开始似乎是不可能的。到目前为止,我一直在尝试使用:
print "Write something";
print "This is not in the same line";
我知道我可以将字符串与& 连接起来,但这并不能解决我的用例。有谁知道如何在 AMPL 的同一行打印?
【问题讨论】:
标签: ampl
大家晚上好!我有这个愚蠢的问题,但我在语言手册中找不到解决方案。它开始似乎是不可能的。到目前为止,我一直在尝试使用:
print "Write something";
print "This is not in the same line";
我知道我可以将字符串与& 连接起来,但这并不能解决我的用例。有谁知道如何在 AMPL 的同一行打印?
【问题讨论】:
标签: ampl
printf "Write something";
printf "This is in the same line";
printf "\nThis is a new line";
有关选项的更多详细信息,请参阅AMPL printf documentation。 print 适用于简单的输出语句,printf 为您提供更多功能来微观管理输出的打印方式。
【讨论】:
printf "Whatever %u", varname 以防万一有人在看它。非常感谢。