為什么顯示不自動換行呀
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
? ? ? ? // 變量保存成績
? ? ? ? int score = 53;?
? ? ? ??
? ? ? ? // 變量保存加分次數(shù)
? ? ? ? int count = 0;
System.out.print("加分前成績"+score);
System.out.print();
? ? ? ? //打印輸出加分前成績?
? ? ? ? ??
? ? ? while(score<60){
? ? ? ? ? score++;
? ? ? ? ? count++;
? ? ? }
? ? ?System.out.print("加分后成績"+score);?
? ? ?System.out.print();
? ? System.out.print("共加了"+count+"次");
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ??
2016-08-23
在java中實現(xiàn)換行有兩種方式:
在System.out.print輸出語句后面加\n,
使用System.out.println語句進行輸出,自動帶換行效果
方便請采納。換書看,努力攢分中...
2016-08-22
在輸出語句后面加\n,
比如?System.out.print("加分后成績"+score+"\n");?