import java.util.Scanner;
class D1 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("请输入第一个数字");
int a = sc.nextInt();
System.out.print("请输入第二个数字");
int b = sc.nextInt();
int c = add(a,b);
System.out.println("这两个数的和是"+c);
}
public static int add(int x,int y) {
return x+y;
}
}
|
|