十五、java的基本数据类型
生活随笔
收集整理的這篇文章主要介紹了
十五、java的基本数据类型
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
public class Sort {public static void sort() {Scanner input = new Scanner(System.in);int sort[] = new int[10];int temp;System.out.println("請輸入10個排序的數據:");for (int i = 0; i < sort.length; i++) {sort[i] = input.nextInt();}for (int i = 0; i < sort.length - 1; i++) {for (int j = 0; j < sort.length - i - 1; j++) {if (sort[j] < sort[j + 1]) {temp = sort[j];sort[j] = sort[j + 1];sort[j + 1] = temp;}}}System.out.println("排列后的順序為:");for(int i=0;i<sort.length;i++){System.out.print(sort[i]+" ");}}public static void main(String[] args) {sort();}
}
總結
以上是生活随笔為你收集整理的十五、java的基本数据类型的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hdu2964-Prime Bases
- 下一篇: 命令行下django-admin.py参