00000000 00000000 00000000 00001001
正数反码补码原码都一样
负数原码,反码符号位不变、其他位不变,
补码码符号位不变、其他位不变,末尾加1
9
原码:00000000 00000000 00000000 00001001
反码:
00000000 00000000 00000000 00001001
补码:
00000000 00000000 00000000 00001001
-9
原码:10000000 00000000 00000000 00001001
反码:
11111111 11111111 11111111 11110110
补码:
11111111 11111111 11111111 111101101
1234
BGHD
int,byte,short,long,float,double,
char,boolean,
6种
s`d
t't'q'we'y
觉得会尽快回来看合力科技
dlkclo活动时间很多客户数控刀具2ksjkdjkjs
~12(8(*9;'[kdsjfkjeljijkjkSJ;Lf;jlJf;jfkJuejlJlfjlJjejkejifsijfjj*&&*&^&*^**&&&$$$$$$$$$fflk5%&8(08(**(***^&$%^$ dkks<>》
八kwjdkj's;;' ^&*&^^%(**(&*&*(&(*(*(whritehellohellofuckmotherfather
1-如何接收用户键盘输入的数据
import java.util.Scanner;
Scanner s = new Scanner(System.in);
s.nextInt();
1-break的第一个作用:用来跳出switch语句
2-break的第二个作用:用来跳出循环
1-
for 循环适用于已知要循环的顺序
while循环适用于已知循环的条件
import java.util.Scanner;
Scanner s = new Scanner(System.in);
s.nextInt();
continue 中断当前循环,继续执行后续循环,只用于循环中。
break跳出当前最近的循环,后续都不再执行。
return可以yong
特殊的用法:
if()
Xxx;
Xxx;
public class IfDemo{
public static void main(String[] args){
int hp = 3;
if(hp<=0)
System.out.println("已经死亡");//if语句判定条件
System.out.println("GameOver");
//if(hp<=0){
//System.out.println("已经死亡");
//}else{
//System.out.println("还活着");
//}
//if(hp>0){
//System.out.println("还活着");
//}0-1000
//0-100 D
//101-300 C
//301-500 B
//501-600 A
//601-700 S
//701-800 SS
//801-1000 SSS
int score = 800;
if(score >= 0 && score<=100 ){
System.out.println("你获得的评级是:D");
}
if(score >= 101 && score<=300 ){
System.out.println("你获得的评级是:C");
}
if(score >= 301 && score<=500 ){
System.out.println("你获得的评级是:B");
}
if(score >= 501 && score<=600 ){
System.out.println("你获得的评级是:A");
}if(score >= 601 && score<=700 ){
System.out.println("你获得的评级是:S");
}if(score >= 701 && score<=800 ){
System.out.println("你获得的评级是:SS");
}if(score >= 801 && score<=1000 ){
System.out.println("你获得的评级是:SSS");
}
}
}
if();
public class IfDemo{
public static void main(String[] args){
int hp = 3;
if(hp<=0);//此时if语句为结束语句
System.out.println("已经死亡");
System.out.println("GameOver");
//if(hp<=0){
//System.out.println("已经死亡");
//}else{
//System.out.println("还活着");
//}
//if(hp>0){
//System.out.println("还活着");
//}0-1000
//0-100 D
//101-300 C
//301-500 B
//501-600 A
//601-700 S
//701-800 SS
//801-1000 SSS
int score = 800;
if(score >= 0 && score<=100 ){
System.out.println("你获得的评级是:D");
}
if(score >= 101 && score<=300 ){
System.out.println("你获得的评级是:C");
}
if(score >= 301 && score<=500 ){
System.out.println("你获得的评级是:B");
}
if(score >= 501 && score<=600 ){
System.out.println("你获得的评级是:A");
}if(score >= 601 && score<=700 ){
System.out.println("你获得的评级是:S");
}if(score >= 701 && score<=800 ){
System.out.println("你获得的评级是:SS");
}if(score >= 801 && score<=1000 ){
System.out.println("你获得的评级是:SSS");
}
}
}
注意事项
三元运算符可以实现的都可以使用if语句代替
区别:
三元运算符比较简洁
三元运算符必须返回结果
if语句可以执行多条语句
public class IfDemo{
public static void main(String[] args){
//int hp = 3;
//if(hp<=0);
//System.out.println("已经死亡");
//System.out.println("GameOver");
//if(hp<=0){
//System.out.println("已经死亡");
//}else{
//System.out.println("还活着");
//}
//if(hp>0){
//System.out.println("还活着");
//}0-1000
//0-100 D
//101-300 C
//301-500 B
//501-600 A
//601-700 S
//701-800 SS
//801-1000 SSS
/*
int score = 800;
if(score >= 0 && score<=100 ){
System.out.println("你获得的评级是:D");
}
if(score >= 101 && score<=300 ){
System.out.println("你获得的评级是:C");
}
if(score >= 301 && score<=500 ){
System.out.println("你获得的评级是:B");
}
if(score >= 501 && score<=600 ){
System.out.println("你获得的评级是:A");
}if(score >= 601 && score<=700 ){
System.out.println("你获得的评级是:S");
}if(score >= 701 && score<=800 ){
System.out.println("你获得的评级是:SS");
}if(score >= 801 && score<=1000 ){
System.out.println("你获得的评级是:SSS");
}
*/
int a = 9 ,b =20;
int max = a>b?a:b;
if(a>b){
max = a;
}else{
max=b;
}
}
}
Cd打开目录
1/2
2/A.G
3/