#10914: 找不出哪裡錯了 我是菜鳥


20235465 (jackyfu)

學校 : 不指定學校
編號 : 57654
來源 : [114.40.90.204]
最後登入時間 :
2016-06-11 18:34:42
a003. 兩光法師占卜術 | From: [114.40.98.213] | 發表日期 : 2016-05-11 17:05

//hasnext 和 nextint 是甚麼意思阿 我是照抄的 幫幫忙 感恩

package tw.LanYao.myproject.HomeWork;

import java.util.Scanner;

public class Test002 {

public static void main(String[] args) {
Scanner Nember = new Scanner(System.in);

//另外 這裡如果在打一個Scanner Nember1 = new Scanner(System.in);會有問題嗎
while (nember.hasNext()) {
int M = nember.nextInt();
int D = nember.nextInt();
int S = (M*2+D)%3;
if (S == 0){
System.out.println("普通");}
if (S == 1){
System.out.println("吉");}
else {
System.out.println("大吉");}
}
}
}

 
#10916: Re:找不出哪裡錯了 我是菜鳥


g165117 (熊仔)

學校 : 台南應用科技大學
編號 : 50320
來源 : [101.12.48.9]
最後登入時間 :
2016-05-11 22:22:54
a003. 兩光法師占卜術 | From: [101.12.48.9] | 發表日期 : 2016-05-11 21:17

//hasnext 和 nextint 是甚麼意思阿 我是照抄的 幫幫忙 感恩

package tw.LanYao.myproject.HomeWork;

import java.util.Scanner;

public class Test002 {

public static void main(String[] args) {
Scanner Nember = new Scanner(System.in);

//另外 這裡如果在打一個Scanner Nember1 = new Scanner(System.in);會有問題嗎
while (nember.hasNext()) {
int M = nember.nextInt();
int D = nember.nextInt();
int S = (M*2+D)%3;
if (S == 0){
System.out.println("普通");}
if (S == 1){
System.out.println("吉");}
else {
System.out.println("大吉");}
}
}
}

import java.util.Scanner;

public class member {

public static void main(String[] args) {

Scanner Nember = new Scanner(System.in);

while (Nember.hasNext()) {

int M = Nember.nextInt();

int D = Nember.nextInt();

int S = (M*2+D)%3;

if (S == 0){

System.out.println("普通");

break;

}

if(S == 1){

System.out.println("吉");

}else {

System.out.println("大吉");

}

}

}

}

新手看過..有錯請告知QQ 




 
ZeroJudge Forum