diff --git "a/22 \346\226\275\346\231\237\345\256\270/\345\274\202\345\270\270\344\275\234\344\270\232.md" "b/22 \346\226\275\346\231\237\345\256\270/\345\274\202\345\270\270\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..8b3853f7e6a37dcdee1c312065147ea53b95c7cc --- /dev/null +++ "b/22 \346\226\275\346\231\237\345\256\270/\345\274\202\345\270\270\344\275\234\344\270\232.md" @@ -0,0 +1,25 @@ +```java +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + while (true) { + try { + System.out.println("请输入一个数字:"); + int x = sc.nextInt(); + System.out.println("请再输入一个数字:"); + int y = sc.nextInt(); + int sum =x+y; + System.out.println("这两个数的和是:" + sum); + return; + } catch (Exception e) { + System.out.println("输入的数不符合标准,请重新输入!!!"); + sc.next(); + } + + } + + } +} +``` \ No newline at end of file