diff --git "a/08 \345\256\230\346\226\207\350\257\232/20230510 \345\274\202\345\270\270.md" "b/08 \345\256\230\346\226\207\350\257\232/20230510 \345\274\202\345\270\270.md" new file mode 100644 index 0000000000000000000000000000000000000000..28bf1a3c6ee2e58c7a79291238f4589646b73649 --- /dev/null +++ "b/08 \345\256\230\346\226\207\350\257\232/20230510 \345\274\202\345\270\270.md" @@ -0,0 +1,26 @@ +### 作业 + +~~~ java +import java.util.Scanner; + +public class Lxi { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + while (true){ + System.out.println("输入整数:"); + + try { + int a= sc.nextInt(); + int b=sc.nextInt(); + System.out.print("整数和是:"); + System.out.println(a+b); + break; + }catch (Exception e){ + System.out.println("只能是整数"); + } + } + } + +} +~~~ +