高手们帮我看看为什么这个程序运行不出来,谢谢了.public class tuzi {
public static void main(String args[]) {
long f1, f2;
int i;
f1 = f2 = 1;
for (i = 1; i <= 20; i++) {
System.out.printf("%12ld%12ld", f1, f2);
if (i % 2 == 0) {
System.out.printf("\n");
}
f1 = f1 + f2;
f2 = f1 + f2;
}
}
}
System.out.printf不能这么用
学C出身的吧
System.out.printf不能这么用
====================================
你看看JAVA是不是有这个方法????
去掉l
public class tuzi {
public static void main(String args[]) {
long f1, f2;
int i;
f1 = f2 = 1;
for (i = 1; i <= 20; i++) {
System.out.printf("%-12d%-12d", f1, f2);
if (i % 2 == 0) {
System.out.printf("\n");
}
f1 = f1 + f2;
f2 = f1 + f2;
}
}
}