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開...
52 則留言:
public class b10033016 {
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3 };
int temp;
for(int j=0;j<a.length;j++)
{
for(int i=0;i<a.length-1;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
for(int i=0;i<a.length;i++)
{
System.out.println(a[i]);
}
System.out.println("MaxValue:"+a[4]);
System.out.println("MinValue:"+a[0]);
}
}
public class Hello502 {
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3 };
int temp;
for(int j=0;j<a.length;j++){
for(int i=0;i<a.length-1;i++){
if(a[i]>a[i+1]){
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
for(int i=0;i<a.length;i++){
System.out.println(a[i]);
}
System.out.println("MaxValue:"+a[4]);
System.out.println("MinValue:"+a[0]);
}
}
public class test {
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3 };
int temp;
for(int j=0;j<a.length;j++)
{
for(int i=0;i<a.length-1;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
for(int i=0;i<a.length;i++)
{
System.out.println(a[i]);
}
System.out.println("MaxValue:"+a[4]);
System.out.println("MinValue:"+a[0]);
}
}
public class DX {
static int min(int [] a)
{
int x=a[0];
for(int i=1; i<a.length;i++)
{
if (x>a[i])
x=a[i];
}
return x ;
}
public static void main(String[] args) {
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
}
}
public class hello {
static int min(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello{
static int min(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main (String [] args){
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class MaxMin0503 {
static int min(int [] a)
{ int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
// TODO code application logic here
int [] a={5,7,8,2,3};
System.out.println("Min=" +min(a));
}
}
public class aa {
static int min (int [] a)
{
int x=a[0];
for(int i=1;i<a.length; i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
}
}
public class abc {
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3 };
int temp;
for(int j=0;j<a.length;j++)
{
for(int i=0;i<a.length-1;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
System.out.println("MaxValue:"+a[4]);
System.out.println("MinValue:"+a[0]);
}
}
public class asd{
public static void main(String[] args){
int[] a={5,7,8,2,3};
int temp;
for(int j=0;j<a.length;j++)
{
for(int i=0;i<a.length-1;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
for(int i=0;i<a.length;i++)
{
System.out.println(a[i]);
}
System.out.println("Max="+a[4]);
System.out.println("Min="+a[0]);
}
}
public class test1
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class hello {
static int min (int [] a)
{
int x=a [0];
for (int i=1 ; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max (int [] a)
{
int x=a [0];
for (int i=1 ; i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String [] args) {
int[] a = {5 , 7 , 8 , 2 , 3 };
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello {
static int min (int [] a)
{
int x=a [0];
for (int i=1;i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max (int [] a)
{
int x=a [0];
for (int i=1;i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] atgs){
int [] a = {5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class bg {
static int min(int [] a)
{
int x=a[0];
for(int i=1; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for(int i=1; i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class test1
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class hello{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class hello
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class haha
{
static int min(int[]b)
{
int x=b[0];
for(int i=1;i<b.length;i++)
{
if(x>b[i])
x=b[i];
}
return x;
}
static int max(int[]b)
{
int x=b[0];
for(int j=1;j<b.length;j++)
{
if(x<b[j])
x=b[j];
}
return x;
}
public static void main(String[]args){
int b[]={5,7,8,2,3};
System.out.println("min="+min(b));
System.out.println("max="+max(b));
}
}
public class hello {
static int min(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class lava
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class ii {
static int min(int [] a )
{
int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
public static void main (String[] args) {
int[] a ={5,7,8,2,3 };
System.out.println("min="+min(a));
}
}
public class hello503{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class psp{
static int min(int[]a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int[]a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[]args){
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello {
static int min(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class psp{
static int min(int[]a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int[]a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[]args){
int[]a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class b10033016
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class eea {
static int min(int [] a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for (int i=1; i<a.length;i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class test
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class test2
{
public static void main(String[] args)
{
int a[]=new int[5];
⋯⋯ for (int i=0; i<a.length; i++)
{
a[i]=(int)(100*Math.random());
System.out.println(a[i]);
}
}
}
public class test1
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class test1
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;ia[i])
x=a[i];
return x;
}
}
public class MaxNMin {
public static void main(String[] args){
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;ia[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class test1
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
⋯⋯ System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class MaxNMin {
static int min(int [] a)
{
int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{
int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a = { 5, 7, 8, 2, 3 };
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello503{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class test
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class hello
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class AAA
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class aa
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class hello2 {
public static void main(String[] args) {
int a[]={5,7,8,2,3};
System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class hello2 {
public static void main(String[] args) {
int a[]={5,7,8,2,3};
System.out.println("min="+min(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
}
public class tgtg{
static int min(int [] a)
{
int x=a[0];
for (int i=1; ia[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a = {5, 7, 8, 2, 3};
System.out.println("min="+min(a));
}
}
public class asd{
static int min(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
⋯⋯ {
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello{
static int min(int[] a){
int x=a[0];
for(int i=1;ia[i])
x=a[i];
}
return x;
}
static int max(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}更多
public class a
{
public static void main(String[] args)
{
int []a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
static int min (int []a)
{
int x=a[0];
for (int i=1;i<a.length;i++)
if (x>a[i])
x=a[i];
return x;
}
static int max (int []a)
{
int x=a[0];
for (int j=1;j<a.length;j++)
if (x<a[j])
x=a[j];
return x;
}
}
public class destiny {
static int min(int [] a)
{int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[] a = {5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class destiny {
static int min(int [] a)
{int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x>a[i])
x=a[i];
}
return x;
}
static int max(int [] a)
{int x=a[0];
for (int i=1; i<a.length; i++)
{
if (x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args) {
int[] a = {5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class hello0503{
static int min(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
import java.util.*;
class a{
public static void main (String[] args)
int [] a=new int[100];
for (int i=0'i<a.length;i++)
{
a[i]=(int)(Math.random()*100);
System.out.println("0-99亂數:"++":"+[i]);
}
System.out.println("+++++++++++++++++++++++++");
Random rnd=new Random();
for (int i=0;i<a.length;i++)
{
a[i]=rnd.nextInt(99);
System.out.println("0-99亂數:"+i":"a+[i]);
}
}
public class go {
static int min(int[]a)
{int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>(i))
x=a[i];
}
return x;
}
static int max(int[]a)
{int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,10,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class minmax{
static int min(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x>a[i])
x=a[i];
}
return x;
}
static int max(int[] a){
int x=a[0];
for(int i=1;i<a.length;i++)
{
if(x<a[i])
x=a[i];
}
return x;
}
public static void main(String[] args){
int[] a={5,7,8,2,3};
System.out.println("min="+min(a));
System.out.println("max="+max(a));
}
}
public class b10033017 {
public static void main(String[] args) {
int[] a = { 5, 7, 8, 2, 3 };
int temp;
for(int j=0;j<a.length;j++)
{
for(int i=0;i<a.length-1;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
for(int i=0;i<a.length;i++)
{
System.out.println(a[i]);
}
System.out.println("MaxValue:"+a[4]);
System.out.println("MinValue:"+a[0]);
}
}
張貼留言