sortarrary v1.0

Review Request #1888 — Created March 22, 2020 and updated

guest1942
imu
0
1024, 1025
demo
guest4789

sortarrary v1.0 is a sort for arrary.

package sortarrary;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class sort {
	private int geshu = 0;
	private int[] data = new int[100];

	public static int[] sortarray(int[] data) { // ???????????????????
		for (int i = 0; i < data.length; i++) {
			for (int j = 0; j < data.length - i - 1; j++) {
				if (data[j] > data[j + 1]) {
					swap(data, j, j + 1);
				}
			}
		}
		return data;
	}

	public static void swap(int[] data, int x, int y) {
		int temp = data[x];
		data[x] = data[y];
		data[y] = temp;
		// System.out.println(data[x]);
	}

	public static void print(int[] data, int geshu) {
		for (int i = 100 - geshu; i < 100; i++)
			System.out.print(data[i] + ",");

	}

	public static void main(String[] args) throws IOException {
		sort sort1 = new sort();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("????????");
		sort1.geshu = Integer.parseInt(br.readLine());
		for (int j = 0; j < sort1.geshu; j++)
			sort1.data[j] = 0;

		for (int i = 0; i < sort1.geshu; i++) {
			System.out.println("?????????" + (i + 1) + "???");
			sort1.data[i] = Integer.parseInt(br.readLine());
		}

		sort1.sortarray(sort1.data);
		sort1.print(sort1.data, sort1.geshu);
	}

}
Description From Last Updated

guest5295guest5295

not okay

guest5529guest5529

fsdfsdfasdfasdf

guest1672guest1672

??????

guest1840guest1840

Test

guest1840guest1840

test1

guest9926guest9926

test2

guest9926guest9926

nut bustasss ship it

guest8649guest8649

dfhksjf

guest3140guest3140
guest1942
guest1942
guest4789
  1. ok

  2. 
      
guest1942
  1. Ship It!
  2. 
      
guest8829
guest1942
Review request changed
guest5295
guest5529
  1. 
      
  2. not okay

  3. 
      
guest1672
  1. test

  2. 
      
guest1672
  1. 
      
  2. fsdfsdfasdfasdf

  3. 
      
guest1840
guest1840
  1. Ship It!
  2. 
      
guest1840
  1. Test

  2. 
      
guest1840
guest9926
  1. test

  2. 
      
guest9926
guest9926
  1. Ship It!
  2. 
      
guest8649
  1. 
      
  2. nut bustasss ship it

    1. delet this

    2. https://www.youtube.com/watch?v=9Gc4QTqslN4

  3. 
      
guest3140
  1. 
      
  2. dfhksjf

  3. 
      
guest1646
  1. Ship It!
  2. 
      
guest9363
  1. 
      
  2. 
      
guest9363
  1. 
      
  2. 
      
Loading...