package jby;
import java.util.Scanner;
public class jby {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
point();
int a=input.nextInt();
int b=input.nextInt();
point(a,b);
}
public static void point(){System.out.println("输入两个坐标点");
System.out.println("x=");
System.out.println("y=");
}
public static void point(int a,int b){
Scanner input=new Scanner(System.in);
System.out.println("输入两个坐标平移的值");
System.out.println("x=");
System.out.println("y=");
int dx,dy;
dx=input.nextInt();
dy=input.nextInt();
int x=a+dx;
int y=b+dy;
System.out.println("x点的坐标为"+x+"\ty点的坐标为"+y);
}
}
package jby;
import java.util.Scanner;
public class jby {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("输入长");
int length=input.nextInt();
System.out.println("输入宽");
int width=input.nextInt();
showAll(length,width);
}
public static int getArea(int x,int y){
return x*y;
}
public static int getPer(int a,int b){
return 2*(a+b);
}
public static void showAll(int x,int y){
int s=getArea(x,y);
int c=getPer(x,y);
System.out.println("长为"+x);
System.out.println("宽为"+y);
System.out.println("周长为"+c);
System.out.println("面积为"+s);
}
}
package jby;
import java.util.Scanner;
public class jby {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("输入颜色");
String Char=input.next();
System.out.println("输入型号");
String cpu=input.next();
showAll(Char,cpu);
you(Char,cpu);
}
public static String you(String x,String y){
Scanner input=new Scanner(System.in);
System.out.println("输入新的颜色属性");
x=input.next();
System.out.println("输入新的型号属性");
y=input.next();
System.out.println("新的颜色属性为"+x);
System.out.println("新的型号属性为"+y);
return you(x, y);
}
public static void wu(){
Scanner input=new Scanner(System.in);
String a,b;
System.out.println("输入颜色");
a=input.next();
System.out.println("输入型号");
b=input.next();
}
public static void showAll(String x,String y){
System.out.println("颜色属性为"+x);
System.out.println("型号属性为"+y);
}
}