这是我的代码:
float e[10]=new float[10];
有什么方法可以将所有10个浮点数格式化为格式字符串?也许在Python中是这样的:
a=range(10)
print ('#'+'(%f)'*10+'#')%tuple(a)
java中有没有这样的方法?对于array_size 3,我的意思是得到像“#(1.0)(2.0)(3.0)#”这样的字符串。
float e[10]=new float[10];
System.out.println(Arrays.toString(e));
试试这个
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句