diff --git "a/22 \345\221\250\345\205\203\344\277\212\344\270\264/20230512 \345\274\202\345\270\270.md" "b/22 \345\221\250\345\205\203\344\277\212\344\270\264/20230512 \345\274\202\345\270\270.md" new file mode 100644 index 0000000000000000000000000000000000000000..cf37d5eb22e3e5a6ceffcdc9e42162fc4e830589 --- /dev/null +++ "b/22 \345\221\250\345\205\203\344\277\212\344\270\264/20230512 \345\274\202\345\270\270.md" @@ -0,0 +1,27 @@ +```java + +import java.util.Scanner; + +public class D1 { + public static void main(String[] args) { + while (true) { + try { + Scanner sc = new Scanner(System.in); + System.out.println("输入第一个整数"); + int a = sc.nextInt(); + System.out.println("输入第二个整数"); + int b = sc.nextInt(); + ab(a, b); + System.out.println(a + b); + break; + } catch (Exception e) { + System.out.println("输入错误"); + + } + } + } + private static int ab(int a,int b) { + return a+b; + } +} +``` \ No newline at end of file