public class HelloWorld {
public static void main(String[] args) {
int one = 20 ;
if(one%2==0){
System.out.println("one是偶数");
}
}
}
public static void main(String[] args) {
int one = 20 ;
if(one%2==0){
System.out.println("one是偶数");
}
}
}
2020-03-02
https://blog.csdn.net/hdjbdbfj/article/details/104497700
https://blog.csdn.net/qq_41119146/article/details/103846095
https://blog.csdn.net/qq_41119146/article/details/103846095
2020-03-02
three=one+two;
System.out.println("three=one+two==>"+three);
three += one;
System.out.println("three+=one==>"+three);
three -= one;
System.out.println("three-=one==>"+three);
three *= one;
System.out.println("three=one+two==>"+three);
three += one;
System.out.println("three+=one==>"+three);
three -= one;
System.out.println("three-=one==>"+three);
three *= one;
2020-03-02
int score=94;
String sex="女";
if(score>80) {
if(sex.equals("女")) {
System.out.print("进入女子决赛");
} else {
System.out.print("淘汰");}
} else {
System.out.print("进入男子决赛");
}
}
}
String sex="女";
if(score>80) {
if(sex.equals("女")) {
System.out.print("进入女子决赛");
} else {
System.out.print("淘汰");}
} else {
System.out.print("进入男子决赛");
}
}
}
2020-02-29
public class HelloWorld {
public static void main(String[] args) {
int age=25;
if(age>=18) {
System.out.println("成年");
} else {
System.out.println("未成年");
}
}
}
public static void main(String[] args) {
int age=25;
if(age>=18) {
System.out.println("成年");
} else {
System.out.println("未成年");
}
}
}
2020-02-29
while(score<=60){
score++;
if(score==60){
break;
}
}
for(count=0;count<=7;count++){
if(count==7){
break;
}
}
上面三种方法都可以实现
score++;
if(score==60){
break;
}
}
for(count=0;count<=7;count++){
if(count==7){
break;
}
}
上面三种方法都可以实现
int score=53;//保存成绩
int count=0;//保存加分次数
System.out.println(“加分前成绩”+score);
for(score=53;score<=60;score++){
count++;
if(score==60){
count-=1;
break;
}
}
System.out.println(“加分后成绩”+score);
System.out.println(“共加了”+count+“次”)
int count=0;//保存加分次数
System.out.println(“加分前成绩”+score);
for(score=53;score<=60;score++){
count++;
if(score==60){
count-=1;
break;
}
}
System.out.println(“加分后成绩”+score);
System.out.println(“共加了”+count+“次”)
public class HelloWorld {
public static void main(String[] args) {
int score = 94;
String sex = "女";
if(score>80)
if(sex=="女")
System.out.println("进入女子组决赛");
else
System.out.println("进入男子组j决赛");
else
System.out.println("对不起你没进决赛");
}
}
public static void main(String[] args) {
int score = 94;
String sex = "女";
if(score>80)
if(sex=="女")
System.out.println("进入女子组决赛");
else
System.out.println("进入男子组j决赛");
else
System.out.println("对不起你没进决赛");
}
}
2020-02-26