📄 exercise5_3.java
字号:
// Exercise5_3.java: Enter 10 integers and
// display the numbers in reverse order
import javax.swing.JOptionPane;
public class Exercise5_3 {
public static void main (String[] args) {
int[] num = new int[10];
for (int i = 0; i < 10; i++) {
// Read a number
String dataString = JOptionPane.showInputDialog(null,
"Read a number:",
"Exercise5_3", JOptionPane.QUESTION_MESSAGE);
num[i] = Integer.parseInt(dataString);
}
// Display the array
for (int i = 9; i >= 0; i--) {
System.out.println(num[i]);
}
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -