Java 打印循环:在每次迭代时输出 'Hello and welcome!'
public class Main { public static void main(String[] args) { System.out.printf('Hello and welcome!');
for (int i = 1; i <= 5; i++) {
System.out.println('i = ' + i);
System.out.printf('Hello and welcome!'); // 添加该行代码
}
}
}
原文地址: https://www.cveoy.top/t/topic/n6Wv 著作权归作者所有。请勿转载和采集!