diff --git "a/26 \351\231\210\346\231\223\347\201\277/20230510 \351\231\210\346\231\223\347\201\277\345\274\202\345\270\270.md" "b/26 \351\231\210\346\231\223\347\201\277/20230510 \351\231\210\346\231\223\347\201\277\345\274\202\345\270\270.md" new file mode 100644 index 0000000000000000000000000000000000000000..8b089dcde5a50ae40ff4de3d7dc6df6203f9262b --- /dev/null +++ "b/26 \351\231\210\346\231\223\347\201\277/20230510 \351\231\210\346\231\223\347\201\277\345\274\202\345\270\270.md" @@ -0,0 +1,28 @@ +```java +package zy0510; + +import java.util.Scanner; + +public class zy- { + public static void main(String[] args) { + int a = 0; + int b = 0; + Scanner sc = new Scanner(System.in); + while (true) { + try { + System.out.println("请输入第一个数"); + a = sc.nextInt(); + System.out.println("请输入第二个数"); + b = sc.nextInt(); + } catch (Exception e) { + System.out.println("输入有误,请重新输入"); + sc.next(); + continue; + } + System.out.println(a+b); + } + + } +} +``` +