public static void main(String[] args){
int x=0,y=1;
if(++x==y-- & x++==1||--y==0)
System.out.println("x="+x+",y="+y);// x=2,y=0
else
System.out.println("y="+y+",x="+x);
}
}
class Dyy1{
public static void main(String[] args){
int n = 5,m = 13;
int a;
int b;
a=n^m^n;
b=m^n^m;
n=a;
m=b;
System.out.println("n="+n+",m="+m);
}
}
class Dyy2{
public static void main(String[] args){
int a=3,b=8;
int c=(a>b)?a++:b++;
//
System.out.println("a="+a+"\tb="+b+"\tc="+c); //a=3 b=9 c=8
int d=(a>b)?++a:++b;
//
System.out.println("a="+a+"\tb="+b+"\td="+d); //a=3 b=10 c=10
int e=(a<b)?a++:b++;
//
System.out.println("a="+a+"\tb="+b+"\te="+e); //a=4 b=10 c=3
int f=(a<b)?++a:++b;
//
System.out.println("a="+a+"\tb="+b+"\tf="+f); //a=5 b=10 f=5
}
}
class Dyy5{
public static void main(String[] args){
System.out.println("请输入4位会员卡号:");
int a=input.nextInt();
int b=a%10;
int c=a%100/10;
int e=a/100%10;
int f=a/1000;
int sum=b+c+e+f;
System.out.println("会员卡号"+a+"各位之和:"+sum);
boolean m=(sum>20)?true:false;
System.out.print("是幸运客户吗?"+m);
}
}
class Dyy4{
public static void main(String[] args){
System.out.println("***********消费单************");
System.out.println("购物物品\t单价\t个数\t金额");
System.out.println("T恤\t¥245\t2\t¥190");
System.out.println("网球鞋\t¥570\t1\t¥570");
System.out.println("网球拍\t¥320\t2\t¥320\n");
System.out.println("折扣:\t8折\n消费总金额¥"+sum);
double o=input.nextDouble();
System.out.println("实际交费¥"+o);
double p=o-sum;
System.out.println("找钱¥"+p);
int jifen=(int) ((sum/100)*3);
System.out.println("本次购物所获的积分是:"+jifen);
}
}
class Dyy6{
public static void main(String[] args){
System.out.println("请输入4位会员卡号:");
int a=input.nextInt();
int b=a%10;
int c=a%100/10;
int e=a/100%10;
int f=a/1000;
int sum=b+c+e+f;
System.out.println("会员卡号"+a+"各位之和:"+sum);
boolean m=(sum>20)?true:false;
System.out.print("是幸运客户吗?"+m);
System.out.println("请输入4位会员卡号:");
int a=input.nextInt();
int b=a%10;
int c=a%100/10;
int e=a/100%10;
int f=a/1000;
int sum=b+c+e+f;
System.out.println("会员卡号"+a+"各位之和:"+sum);
boolean m=(sum>20)?true:false;
System.out.print("是幸运客户吗?"+m);