哪里错了呀
public class HelloWorld {
public static void main(String[] args) {
int score = 94;
String sex = "女";
if (score>90);{
if (sex.equals("女")){
System.out.println("进入女子组决赛");
} else {
System.out.println("进入男子组决赛");
}
} else {
System.out.println("淘汰");
}
}
}
public class HelloWorld {
public static void main(String[] args) {
int score = 94;
String sex = "女";
if (score>90);{
if (sex.equals("女")){
System.out.println("进入女子组决赛");
} else {
System.out.println("进入男子组决赛");
}
} else {
System.out.println("淘汰");
}
}
}
2021-03-18
已采纳回答 / qq_慕婉清5130151
代码没有错,能运行只是需要输入了年龄才到到“Please input your age”这句话,所以只需要调换一下顺序import java.util.Scanner;public class HelloWorld { public static void main(String[] args) {Scanner s=new Scanner(System.in);System.out.println("Please input your age");int age=s.nextInt();if(ag...
2021-03-15
public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
2021-03-14