- 用random產生double陣列10個元素
- 排序
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
python pandas對黃金、外匯匯率的爬蟲練習,並使用matplotlib.pyplot的函數plot, scatter做資料視覺化處理,採用numpy的統計函數,分析黃金價格波動與歐元走勢的關聯。
-
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String 多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例...
-
你會用C的算子sizeof?
36 則留言:
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0;i<a.length-1;i++)
for (int j=0;j<a.length-1-i;j++){
if (a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class aaa {
public static void main(String[] args) {
double [] a = new double [10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0; i<a.length-1; i++)
for(int j=0 ;j<a.length-1-i; j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class aaa {
public static void main(String[] args) {
double [] a = new double [10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0; i<a.length-1; i++)
for(int j=0 ;j<a.length-1-i; j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class aaa {
public static void main(String[] args) {
double [] a = new double [10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0; i<a.length-1; i++)
for(int j=0 ;j<a.length-1-i; j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class lion {
public static void main(String[] args) {
double[] a=new double[10];
Random rnd =new Random();
for(int i=0; i<a.length;i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0;i<a.length-1;i++)
for(int j=0;j<a.length-1;j++){
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello;
import java.util.*;
public class ex2 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class Ex01 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hey001;
import java.util.*;
public class hey123 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class Ex01 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package helllo;
import java.util.*;
public class hello {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0;i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class Ex01 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package helen;
import java.util.*;
public class helen0513 {
public static void main(String[] args) {
double [] a=new double[10];
Random rnd=new Random();
for (int i = 0; i < a.length; i++) {
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for (int i = 0; i < a.length-1; i++)
for (int j = 0; j < a.length-1; j++)
if(a[j]>a[(int) (j+1)]){
double tmp=a[j];
a[j]=a[(j+1)];
a[(j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class hello {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class ex1 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello;
import java.util.Random;
public class hello {
public static void main(String[] args) {
// TODO Auto-generated method stub
double [] a=new double[10];
Random rnd=new Random();
for (double i = 0; i < a.length; i++) {
a[(int) i]=rnd.nextInt(100);
System.out.print(a[(int) i]+"\t");
}
System.out.println();
int j = 0;
for (double i = 0; j < a.length-1; j++)
if(a[(int) j]>a[(int)(j+1)]){
double tmp=a[(int) j];
a[(int) j]=a[(int) (j+1)];
a[(int) (j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello;
import java.util.Random;
public class hello {
public static void main(String[] args) {
// TODO Auto-generated method stub
double [] a=new double[10];
Random rnd=new Random();
for (double i = 0; i < a.length; i++) {
a[(int) i]=rnd.nextInt(100);
System.out.print(a[(int) i]+"\t");
}
System.out.println();
int j = 0;
for (double i = 0; j < a.length-1; j++)
if(a[(int) j]>a[(int)(j+1)]){
double tmp=a[(int) j];
a[(int) j]=a[(int) (j+1)];
a[(int) (j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello;
import java.util.Random;
public class hello {
public static void main(String[] args) {
// TODO Auto-generated method stub
double [] a=new double[10];
Random rnd=new Random();
for (double i = 0; i < a.length; i++) {
a[(int) i]=rnd.nextInt(100);
System.out.print(a[(int) i]+"\t");
}
System.out.println();
int j = 0;
for (double i = 0; j < a.length-1; j++)
if(a[(int) j]>a[(int)(j+1)]){
double tmp=a[(int) j];
a[(int) j]=a[(int) (j+1)];
a[(int) (j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
double [] a=new double[10];
Random rnd=new Random();
for(int i=0 ; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello;
import java.util.Random;
public class hello {
public static void main(String[] args) {
// TODO Auto-generated method stub
double [] a=new double[10];
Random rnd=new Random();
for (double i = 0; i < a.length; i++) {
a[(int) i]=rnd.nextInt(100);
System.out.print(a[(int) i]+"\t");
}
System.out.println();
int j = 0;
for (double i = 0; j < a.length-1; j++)
if(a[(int) j]>a[(int)(j+1)]){
double tmp=a[(int) j];
a[(int) j]=a[(int) (j+1)];
a[(int) (j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello513;
import java.util.Arrays;
import java.util.Random;
public class Ex1 {
public static void main(String[] args) {
Double[]a=new Double[10];
Random rnd=new Random();
for(int i=0;i<a.length;i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(Double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello513;
import java.util.Random;
public class Ex1 {
public static void main(String[] args) {
double [ ] a=new double[10];
Random rnd=new Random();
for (int i=0;i<a.length;i++){
a[i]=rnd.nextDouble();
System.out.print(a[ i ]+" \t ");
}
System.out.println();
for (int i=0;i<a.length-1 ; i++)
for (int j=0;j<a.length-1-i ; j++)
if(a[ j ]>a[ j+1 ]){
double tmp=a[ j ];
a[ j ]=a[ j+1 ];
a[ j+1 ]= tmp;
}
for(double i:a)
System.out.print(i+" \t ");
System.out.println();
}
}
package hello0513;
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a=new double[10];
Random rnd=new Random();
for(int i=0;i<a.length;i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0;i<a.length-1;i++)
for(int j=0;j<a.length-1-i;j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.Arrays;
import java.util.Random;
public class hello {
public static void main(String[] args) {
Double[]a=new Double[10];
Random rnd=new Random();
for(int i=0;i<a.length;i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(Double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package laolin;
import java.util.Random;
public class laolin0513 {
public static void main(String[] args) {
double [] a = new double[10];
Random rnd = new Random();
for(int i=0;i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0;i<a.length-1; i++)
for(int j=0;j<a.length-1-i; j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package dog0857;
import java.util.Random;
public class dog0857 {
public static void main(String[] args) {
double [] a = new double[10];
Random rnd = new Random();
for(int i=0;i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for(int i=0;i<a.length-1; i++)
for(int j=0;j<a.length-1-i; j++)
if(a[j]>a[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hello0513;
import java.util.*;
public class Ex01 {
public static void main(String[] args) {
double [] a= new double[10];
Random rnd=new Random();
for(int i=0; i<a.length; i++){
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package she;
import java.util.Random;
public class she1 {
public static void main(String[] args) {
double [] a=new double[10];
Random rnd=new Random();
for(int i=0;ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
import java.util.Arrays;
public class asasa {
public static void main(String[] args) {
double [] a =new double[10];
Random rnd=new Random();
for(int i=0;i<a.length;i++){
a[i]=rnd.nextDouble()*100;
System.out.print(a[i]+"\t");
}
System.out.println();
Arrays.sort(a);
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class aaa {
public static void main(String[] args) {
double [] a = new double [10];
Random rnd=new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package hihihi;
import java.util.Random;
public class hi0513 {
public static void main(String[] args) {
double [] a = new double[10];
Random rnd = new Random();
for(int i=0;ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
mport java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
mport java.util.Random;
public class ex1 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
package roger2;
import java.util.*;
public class roger665 {
public static void main(String[] args) {
double [] a=new double[10];
Random rnd=new Random();
for (int i = 0; i < a.length; i++) {
a[i]=rnd.nextDouble();
System.out.print(a[i]+"\t");
}
System.out.println();
for (int i = 0; i < a.length-1; i++)
for (int j = 0; j < a.length-1; j++)
if(a[j]>a[(int) (j+1)]){
double tmp=a[j];
a[j]=a[(j+1)];
a[(j+1)]=tmp;
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
import java.util.Random;
public class ex11 {
public static void main(String[] args) {
double [] a= new double [10];
Random rnd = new Random();
for(int i=0; ia[j+1]){
double tmp=a[j];
a[j]=a[j+1];
a[j+1]=tmp;
}
}
for(double i:a)
System.out.print(i+"\t");
System.out.println();
}
}
張貼留言