笔记(五)
push_back(0);為容器末尾添加零。
error: stray ‘\357’ in program
error: stray ‘\357’ in program
error: stray ‘\274’ in program
error: stray ‘\233’ in program
?
出現此類錯誤的原因,在編輯器中使用的utf-8的格式保存源代碼中出現了中文的標點符號
java輸出如果需要控制格式的話可以使用這種格式
System.out.printf("ID:%-10s", M.getID());
System.out.printf("Creator:%-10s", M.getCreator());
System.out.printf("Time:%-30s", M.getTimestamp());
System.out.printf("Filename:%-15s", M.getFilename());
System.out.printf("Description:%-15s", M.getDescription());
System.out.println();
%-10s表示每一列輸出占十個空格大小,且是左對齊。%10s表示右對齊;
vector插入時是不能用下標的,遍歷查詢時才能用下標。
總結
- 上一篇: c++栈和java栈的区别
- 下一篇: JOptionPane提示框的一些常用方