看看哪里錯(cuò)了,在線等,+一積分
public class HelloWorld {
??? public static void main(String[] args) {
?? ??? ?int score = 94;
?? ??? ?String sex = "女";
??????? if (score >80){
??????????? if (sex.equals("男"){
??????????? System.out.println("進(jìn)入男子決賽");
??????????? }else{
??????? System.out.println("進(jìn)入女子決賽");
??????????? }
??????? }else{
??????????? System.out.println("淘汰");
??????? }
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?? ??? ?
?? ?}
}
2016-06-23
2016-07-03
旁邊有錯(cuò)誤英文提示的,看那個(gè)就好了。會指引你哪里少了一個(gè)括號“)”
2016-06-28
第6行,if (sex.equals("男"){
少寫了一個(gè)括號,應(yīng)該是if (sex.equals("男")){
2016-06-28
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ? int score = 94;
? ? ? ? String sex = "女";
? ? ? ??
? ? ? ? if (score >80){
? ? ? ? ? ? if (sex.equals("男")){
? ? ? ? ? ? ? ? System.out.println("進(jìn)入男子決賽");
? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? System.out.println("進(jìn)入女子決賽");
? ? ? ? ? ? }
? ? ? ? }else{
? ? ? ? ? ? System.out.println("淘汰");
? ? ? ? }
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? }
}
2016-06-22
輸入分?jǐn)?shù)為94, 如果分?jǐn)?shù)大于80為外層條件,為條件1,如果為男性為內(nèi)層條件,為條件2成立則輸出男性進(jìn)入決賽,反之則為女性進(jìn)入決賽,如果分?jǐn)?shù)不大于80,則淘汰,我確實(shí)腦子不好,多練習(xí)吧,沒有誰剛開始就牛逼,多謝賜教
2016-06-22
額,我都不知道你的要求是什么,所以把進(jìn)入女子決賽的條件判定成河男子決賽一樣了.
2016-06-22
public class HelloWorld {
??? public static void main(String[] args) {
?? ??? ?int score = 94;
?? ??? ?String sex = "女";
? ? ? ? ? ? if (score >80 && sex.equals("男")){ ? ??
??????????? System.out.println("進(jìn)入男子決賽");
??????????? }else if(score >80 && sex.equals("女")){
? ? ? ? ? ?System.out.println("進(jìn)入女子決賽");
??????????? }
??????? }else{
??????????? System.out.println("淘汰");
??????? }
? ? ? ? &&是表示并且的意思
2016-06-22
..........................? if (sex.equals("男")
2016-06-22
if (sex.equals("男"))
2016-06-22
public class HelloWorld {
? ? public static void main(String[] args) {
int score = 94;
String sex = "女";
? ? ? ? if(score>80 ){
? ? ? ? ? ? if(sex.equals("女")){
? ? ? ? ? ? ? ? System.out.println("進(jìn)入女子組決賽");
? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? System.out.println("進(jìn)入男子組決賽");
? ? ? ? ? ? }
? ? ? ? }
if(sex....)少個(gè)括號