diff --git "a/11 \351\202\271\344\272\250\344\274\237/0509.md" "b/11 \351\202\271\344\272\250\344\274\237/0509.md" new file mode 100644 index 0000000000000000000000000000000000000000..093892c4f9759d65796a3cbfcc322f007597c32e --- /dev/null +++ "b/11 \351\202\271\344\272\250\344\274\237/0509.md" @@ -0,0 +1,21 @@ +``` +public class Test { + public static void main(String[] args) { + + while (true){ + Scanner sc = new Scanner(System.in); + try { + System.out.println("输入两个整数"); + System.out.println("第一个整数"); + int a= sc.nextInt(); + System.out.println("第二个整数"); + int b=sc.nextInt(); + System.out.println(a+b); + } catch (Exception e) { + System.out.println("不能输入整数以外的数字"); + } + } + + } +} +``` \ No newline at end of file