diff --git "a/08 \350\256\270\350\215\243\346\263\225/20230510 \345\274\202\345\270\270.md" "b/08 \350\256\270\350\215\243\346\263\225/20230510 \345\274\202\345\270\270.md" new file mode 100644 index 0000000000000000000000000000000000000000..e47f2eac8a123d8722655251a0380855ddb28f6e --- /dev/null +++ "b/08 \350\256\270\350\215\243\346\263\225/20230510 \345\274\202\345\270\270.md" @@ -0,0 +1,26 @@ +```java +import java.util.Scanner; + +public class Test { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + while(true) { + try { + System.out.println("请输入第一个数"); + double a = sc.nextDouble(); + System.out.println("请输入第二个数"); + double b = sc.nextDouble(); + double c = a+b; + System.out.println("和为:" + c); + break; + } catch (Exception e) { + System.out.println("输入的数据类型有误"); + sc.next(); + + } + } + } +} + +``` +