“java jj 入” 想搵java telegram group;

川口太郎

90 回覆
1 Like 5 Dislike
川口太郎 2018-12-19 13:12:01
是咁的,最近學緊java,想搵人交流下,順便學下嘢,唔知各位巴絲有冇telegram group肯收留小弟,jj插沙
川口太郎 2018-12-19 13:15:00
btw,想從input搵出最大值,但佢永遠只出z既值,想知錯邊,求指教

package javaapplication1;
import java.util.Scanner;
public class JavaApplication1 {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int x=console.nextInt();
int y=console.nextInt();
int z=console.nextInt();
int greatest=0;
if(x>y && x>z)
{greatest = x;}
else if(y>x && y>z)
{greatest = y;}
else if(z>x && z>y);
{greatest = z;}
System.out.print("The greatest is:"+ greatest);
川口太郎 2018-12-19 13:16:40
Push
川口太郎 2018-12-19 13:17:31
Push
川口太郎 2018-12-19 13:18:51
Push
川口太郎 2018-12-19 13:19:37
Push
連弟走得摩 2018-12-19 13:20:19
冇得輸窮三代IT狗 2018-12-19 13:20:49
用依個 library 可以做到你想做嘅嘢

https://deeplearning4j.org
川口太郎 2018-12-19 13:22:31
多謝巴打先,多嘴問句用if else係咪做唔到
川口太郎 2018-12-19 13:23:23
唔該曬巴打
Btw巴打個名
冇得輸窮三代IT狗 2018-12-19 13:23:50
學 coding 唔學 loop,不如唔好學
冇得輸窮三代IT狗 2018-12-19 13:24:53
大大個 tutorial point 同 stack overflow 喺度,點解唔用?
手一黏便緊(UTC+9 2018-12-19 13:25:04
else if(z>x && z>y);
呢行最尾多左個分號
手一黏便緊(UTC+9 2018-12-19 13:26:17
三個數既話 唔用loop比較快 因為loop overhead
川口太郎 2018-12-19 13:26:28
多謝巴打
連弟走得摩 2018-12-19 13:27:06
如果x同y同z value一樣,你可能會出0
無野做好悶 2018-12-19 13:27:47
btw,想從input搵出最大值,但佢永遠只出z既值,想知錯邊,求指教

package javaapplication1;
import java.util.Scanner;
public class JavaApplication1 {
public static void main(String[] args) {
Scanner console = new Scanner(http://System.in);
int x=console.nextInt();
int y=console.nextInt();
int z=console.nextInt();
int greatest=0;
if(x>y && x>z)
{greatest = x;}
else if(y>x && y>z)
{greatest = y;}
else if(z>x && z>y);
{greatest = z;}
System.out.print("The greatest is:"+ greatest);
手一黏便緊(UTC+9 2018-12-19 13:27:49
唔關我事 你下次quote樓主
川口太郎 2018-12-19 13:28:07
學過下for loop 同while loop,想問哩兩個係咪基本嘢?
冇得輸窮三代IT狗 2018-12-19 13:30:49
依個世界好似冇 while loop

你所講嘅 while loop 係咪咁

int i = 5;
for(;i < 5;) {
  System.out.println("來生不做香港 IT 狗");
  ++i;
}
川口太郎 2018-12-19 13:31:21
加句else{System.out.print("Error");}
解唔解決到個問題?
冇得輸窮三代IT狗 2018-12-19 13:31:47
多謝巴打先,多嘴問句用if else係咪做唔到
學 coding 唔學 loop,不如唔好學
學過下for loop 同while loop,想問哩兩個係咪基本嘢?
依個世界好似冇 while loop

你所講嘅 while loop 係咪咁

int i = 0;
for(;i < 5;) {
  System.out.println("來生不做香港 IT 狗");
  ++i;
}

Sor
手一黏便緊(UTC+9 2018-12-19 13:32:29
Why dun you try yourself before asking
冇得輸窮三代IT狗 2018-12-19 13:33:29
Why don't you Google first before asking?
川口太郎 2018-12-19 13:33:46
Anyway,多謝巴打
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞