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開...
44 則留言:
import java.security.SecureRandom;import java.util.*;
public class AH {
public static void main(String[] args) { SecureRandom sc=new SecureRandom(); Scanner input=new Scanner(System.in); int x=sc.nextInt(100)+1; int y=0; do{ System.out.print("猜數字>>>>"); y=input.nextInt(); if(x<y) System.out.println("小一點"); else if(x>y) System.out.println("大一點"); else System.out.print("猜對了 恭喜你"); }while(x!=y); }}
import java.util.Random;import java.util.Scanner;public class aa { public static void main(String[] args) { Random asd =new Random (); int x= asd.nextInt(100)+1; Scanner a=new Scanner(System.in); int s=0; do{System.out.println("輸入:"); s =a.nextInt(); if (s>x)System.out.println("小點"); if (s<x)System.out.println("大點"); } while(s!=x);System.out.println(x); } }
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
a10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}
a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}
import java.util.Random;import java.util.Scanner;public class abcd { public static void main(String[] args) { Random input=new Random(); int x=input.nextInt(100)+1; Scanner qwe=new Scanner(System.in); int a; do{ System.out.print("輸入0~100:"); a=qwe.nextInt(); if(a>x)System.out.print("比"+a+"小"+"\n"); else if(a<x)System.out.print("比"+a+"大"+"\n"); }while(a!=x); System.out.print(x+"終於猜到了"); }}
//B10133007
package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");
}while(guess!=x);
}
}
//B10133007
package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");
}while(guess!=x);
}
}
//A10433006
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
//A10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433001
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
//A10433008
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
//B10133007
package b10133007;
import java.security.SecureRandom;
import java.util.*;
public class ex01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("猜吧!>>");
guess=input.nextInt();
if (x>guess)
System.out.println("你猜太小了");
else if(x<guess)
System.out.println("你猜太大了");
else System.out.println("恭喜你猜對啦");
}while(guess!=x);
}
}
//A10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
A10433004
import java.security.SecureRandom;
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("在大一點");
else if(x<guess)
System.out.println("在小一點");
}while(guess!=x);
if(x==guess)
System.out.println("恭喜你答對囉");
}
a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}
a10433029
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}
//A10433019
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
A10433011
public class hello11 {
public static void main(String[] args) {
SecureRandom rnd = new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100)+1;
int guess= 0;
do{
System.out.println("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("大");
else if(x<guess)
System.out.println("小");
} while(guess!=x);
if(x==guess)
System.out.println("答對囉");
//A10433014
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433007
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433003
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433010
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433036
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
A10433039
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
//A10433043
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
import java.security.SecureRandom;import java.util.*;
public class jimmy1111 { public static void main(String[] args) { SecureRandom rnd= new SecureRandom(); Scanner input=new Scanner(System.in); int x = rnd.nextInt(100) +1; int guess=0; do{ System.out.println("猜>>"); guess=input.nextInt(); System.out.println("請"); }while(guess!=x); }
import java.security.SecureRandom;import java.util.*;
public class jimmy1111 { public static void main(String[] args) { SecureRandom rnd= new SecureRandom(); Scanner input=new Scanner(System.in); int x = rnd.nextInt(100) +1; int guess=0; do{ System.out.println("猜>>"); guess=input.nextInt(); System.out.println("請"); }while(guess!=x); }
public class hello11 {
public static void main(String[] args) {
SecureRandom rnd = new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100)+1;
int guess= 0;
do{
System.out.println("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("大");
else if(x<guess)
System.out.println("小");
} while(guess!=x);
if(x==guess)
System.out.println("答對");
public class hello11 {
public static void main(String[] args) {
SecureRandom rnd = new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100)+1;
int guess= 0;
do{
System.out.println("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("大");
else if(x<guess)
System.out.println("小");
} while(guess!=x);
if(x==guess)
System.out.println("答對了");
a10433024
mport java.util.Random;import java.util.Scanner;
public class hello {
public static void main(String[] args) { Random rnd= new Random(); int x; x=rnd.nextInt(100)+1; Scanner input=new Scanner(System.in); int guess=0; do{ System.out.print("猜>>"); guess=input.nextInt(); if(x>guess) System.out.println("數字太小"); else System.out.println("數字太大"); }while(guess!=x); if(x==guess) System.out.println("猜中數字"); }
}
import java.security.SecureRandom;
import java.util.Scanner;
public class exc029 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.println("猜數字");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
}while(guess!=x);
if(x==guess)
System.out.println("正解");
}
}
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
mport java.util.Random;import java.util.Scanner;
public class hello {
public static void main(String[] args) { Random rnd= new Random(); int x; x=rnd.nextInt(100)+1; Scanner input=new Scanner(System.in); int guess=0; do{ System.out.print("猜>>"); guess=input.nextInt(); if(x>guess) System.out.println("數字太小"); else System.out.println("數字太大"); }while(guess!=x); if(x==guess) System.out.println("猜中數字"); }
}
2015年11月13日 下午3:43
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
Scanner input=new Scanner(System.in);
int x=rnd.nextInt(100)+1;
int guess=0;
do{
System.out.print("猜猜看");
guess=input.nextInt();
if(x>guess)
System.out.println("大一點");
else if(x<guess)
System.out.println("小一點");
else
System.out.println("答對了");
}while(guess!=x);
}
import java.security.SecureRandom;
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
SecureRandom rnd=new SecureRandom();
Scanner input=new Scanner(System.in);
int x = rnd.nextInt(100) + 1;
int guess=0;
do{
System.out.print("請猜數字>>");
guess=input.nextInt();
if(x>guess)
System.out.println("在大一點");
else if(x<guess)
System.out.println("在小一點");
}while(guess!=x);
if(x==guess)
System.out.println("恭喜你答對囉");
}
import java.security.SecureRandom;
import java.util.Scanner;
public class ex_01 {
public static void main(String[] args) {
SecureRandom rnd= new SecureRandom();
int x,y;
x=rnd.nextInt(100)+1;
Scanner input=new Scanner(System.in);
do{
System.out.println("請輸入數字");
y=input.nextInt();
if(x>y)
System.out.println("大一點");
else if(x<y)
System.out.println("小一點");
}while(x!=y);
if(x==y)
System.out.println("答對了");
}
}
張貼留言