herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
你會用C的算子sizeof?
-
XOR prefixsum CPP python解Leetcode 1829 Maximum XOR for Each Query 其實這裡考慮的是元素個數為2^maximumBit的交換群,運算子為XOR。 [Python code請進]
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
25 則留言:
import java.util.Random;
public class aa { public static void main(String[] args) { Random aa = new Random(); int[] b= new int [10]; int []a=new int [100]; int c; for(int i=0;i<a.length;i++){ c=a[i]=aa.nextInt(10); System.out.print(a[i]+"--"); b[c]++; } System.out.println(); for (int s=0;s<b.length;s++) System.out.println(s+"---"+b[s]); }
}
import java.security.SecureRandom;import java.util.*;public class abc { public static void main(String[] args) { SecureRandom input=new SecureRandom(); int x[]=new int[100]; int y=0,a=0,s=0,d=0,f=0,g=0,h=0,j=0,k=0,l=0; for(int i=0;i<x.length;i++){ x[i]=input.nextInt(9); System.out.print("x=["+x[i]+"]"+"\t"); if(i%10==9)System.out.println(); if(x[i]==0) y++; if(x[i]==1) a++; if(x[i]==2) s++; if(x[i]==3) d++; if(x[i]==4) f++; if(x[i]==5) g++; if(x[i]==6) h++; if(x[i]==7) j++; if(x[i]==8) k++; if(x[i]==9) l++; } System.out.println("0出現次數="+y); System.out.println("1出現次數="+a); System.out.println("2出現次數="+s); System.out.println("3出現次數="+d); System.out.println("4出現次數="+f); System.out.println("5出現次數="+g); System.out.println("6出現次數="+h); System.out.println("7出現次數="+j); System.out.println("8出現次數="+k); System.out.println("9出現次數="+l); }}
package rpg;import java.security.SecureRandom;public class fgh {
public static void main(String[] args) { SecureRandom x=new SecureRandom(); int y[]=new int[100]; int c[]=new int[10]; int a; for(int i=0;i<y.length;i++){ a=y[i]=x.nextInt(10); System.out.println(a); c[a]++; } for(int v=0;v<c.length;v++) System.out.println(v+">>>>"+c[v]); }}
import java.security.*;public class a1211 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); }
}
}
import java.security.SecureRandom;import java.util.Arrays;
public class a1211 { public static void main(String[] args) { SecureRandom rnd= new SecureRandom(); int []a=new int[100]; int []count=new int[10]; int y; for (int i = 0; i<a.length; i++) { y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); }
}
}
import java.security.SecureRandom;
public class exc29 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int []x=new int[100]; int []count=new int[10]; int y; for(int i=0; i<x.length; i++ ){ y=x[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
import java.security.*;
public class ex01 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int []a=new int[100]; int []count=new int[10]; int y; for(int i=0; i<a.length; i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9) System.out.println(); count[y]++; } System.out.println(); for(int j=0; j<count.length; j++){ System.out.println(j+"我出現的次數為:"+count[j]); } }}
import java.security.SecureRandom;
public class ex412011 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
import java.util.Random;
public class ex1 {
public static void main(String[] args) {
Random rnd=new Random();
int []x=new int[100];
int []count=new int[10];
int y;
for(int i=0;i<x.length; i++){
y=x[i]=rnd.nextInt(10);
System.out.print(y+",\t");
if(i%10==9) System.out.println();
count[y]++;
}
System.out.println();
for(int a=0;a<count.length;a++){
System.out.println(a+"出現次數:"+count[a]);
}}}
package zz;
import java.util.Random;
public class z1 { public static void main(String[] args) { int []a=new int[100]; int []count=new int [10]; int y; Random rnd=new Random(); for (int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+"\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數"+count[j]); } }}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
import java.security.SecureRandom;public class a1211 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+"\t"); if(i%10==9) System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數"+count[j]); }
}
}
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
package hello;
import java.security.SecureRandom;
public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
import java.security.SecureRandom;
public class exc29 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int []x=new int[100]; int []count=new int[10]; int y; for(int i=0; i<x.length; i++ ){ y=x[i]=rnd.nextInt(10); System.out.print(y+",\t"); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
}
import java.security.SecureRandom;public class ex2 {
public static void main(String[] args) { SecureRandom rnd=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=rnd.nextInt(10); System.out.print(y+"\t"); if(i%10==9) System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數"+count[j]); }
}
}
import java.security.SecureRandom;
public class dsa {
public static void main(String[] args) { SecureRandom AD=new SecureRandom(); int[]a=new int[100]; int[]count=new int[10]; int y; for(int i=0;i<a.length;i++){ y=a[i]=AD.nextInt(10); System.out.print(y+" "); if(i%10==9)System.out.println(); count[y]++; } System.out.println(); for(int j=0;j<count.length;j++){ System.out.println(j+"出現次數:"+count[j]); } }
張貼留言