herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
你會用C的算子sizeof?
-
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations heap/priority queue是重要的資料結構,無論是C++的std::priority_q...
-
C++ DP動態規劃解Leetcode 937 Maximum Number of Points with Cost 有些標示medium要比標示hard的問題還要難,Leetcode 1937. Maximum Number of Points with Cost,DP動態規...
51 則留言:
import java.util.Arrays;
public class weerw {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hi {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+")="+x[i]);
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]"+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0;i<x.length;i++){
System.out.println("x["+i+"]"+x[i]);
}
}
}
import java.util.*;
public class Hi {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
D10333033 江淑婷
import java.util.*;
public class hi {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class java {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0;i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex2 {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0;i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class HI0608 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.Arrays;
import java.util.Random;
public class hello0608 {
public static void main(String[] args) {
int[] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
資管一甲 Y10310066 陳昤瑄
import java.util.*;
public class qwe {
public static void main(String[] args) {
int[]x=new int[20];
Random rnd=new Random();
for (int i=0; i<x. length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+")="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class badboy {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd =new Random();
for(int i=1; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+
"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
D10333034 洪芷茵
import java.util.*;
public class hi {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class java {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0;i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class tx1 {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"="+x[i]);
}
}
}
import java.util.*;
public class tx1 {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"="+x[i]);
}
}
}
import java.util.Arrays;
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++) {
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class Fanny {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
D10333010 柯羿瑄
import java.util.Arrays;
import java.util.Random;
public class JAVA1234 {
public static void main(String[] args) {
int[] x =new int[20];
Random rnd=new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for (int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hi {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
package ex1;
import java.util.*;
public class d10033301 {
public static void main(String[] args){
int[] x =new int[20];
Random rnd = new Random();
for (int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後=");
for (int i=0;i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class qwe {
public static void main(String[] args) {
int [] x= new int [20];
Random rnd=new Random();
for(int i=0; i<x. length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.Arrays;
import java.util.Random;
public class D10333028 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hoor {
public static void main(String[] args) {
int[]x=new int[20];
Random rnd=new Random();
for(int i=0; i=0; i--){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.Arrays;
import java.util.Random;
public class D10333028 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
package d10033203;
import java.util.*;
public class a12345 {
public static void main(String[] args) {
int[] x= new int[20];
Random rnd =new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class b12345 {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd =new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
package d10033203;
import java.util.*;
public class a12345 {
public static void main(String[] args) {
int[] x= new int[20];
Random rnd =new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex2 {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
do{
x[i]=rnd.nextInt(100);
}while(x[i]%2!=1);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0;i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hello {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(50);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hello0608 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hello123 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class YOYO {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(50);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex2 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd =new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
private static int Random(int i, int j) {
// TODO Auto-generated method stub
return 0;
}
}
import java.util.Arrays;
public class weerw {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]"+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0;i<x.length;i++){
System.out.println("x["+i+"]"+x[i]);
}
}
import java.util.*;
public class Fanny {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(50);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class java {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0;i<x.length; i++){
x[i]=rnd.nextInt(50);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0;i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex1 {
public static void main(String[] args)
{
ArrayList tmp = new ArrayList();
ArrayList num = new ArrayList();
for (int i=1;i<100;i+=2)
tmp.add(new Integer(i));
Collections.shuffle(tmp);
System.out.println(tmp.subList(0,19));
for (int i=0;i<20;i++)
num.add(tmp.get(i));
Collections.sort(num);
System.out.println(num.subList(0,19));
}
}
import java.util.*;
public class NINI {
public static void main(String[] args) {
int [] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.Arrays;
public class weerw {
public static void main(String[] args) {
int[] x=new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class hi {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd=new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(100);
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+")="+x[i]);
}
}
package D10333038;
import java.util.*;
public class Hey {
public static void main(String[] args) {
int[] x= new int[20];
Random rnd =new Random();
for(int i=0; i<x.length;i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後:");
for(int i=0; i<x.length;i++){
System.out.println("x["+i+"]="+x[i]);
}
}
}
import java.util.*;
public class ex2 {
public static void main(String[] args) {
int [] x= new int[20];
Random rnd =new Random();
for(int i=0; i<x.length; i++){
x[i]=rnd.nextInt(49);
x[i]=2*x[i]+1;
System.out.println("x["+i+"]="+x[i]);
}
Arrays.sort(x);
System.out.println("排序後");
for(int i=0; i<x.length; i++){
System.out.println("x["+i+"]="+x[i]);
}
}
private static int Random(int i, int j) {
// TODO Auto-generated method stub
return 0;
}
}
張貼留言