Explorar o código

添加 'Project001'

KSE1201 %!s(int64=3) %!d(string=hai) anos
pai
achega
9594347082
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      Project001

+ 16 - 0
Project001

@@ -0,0 +1,16 @@
+int n=1,m=2;
+        while (n<m){
+            Scanner i=new Scanner(System.in);
+            System.out.print("请输入您的姓名:");
+            String name=i.next();
+            System.out.print("请输入您的每月工资:");
+            int salary=i.nextInt();
+            float personaltax= (float) (salary*0.03);
+            System.out.println("您好"+name+",你已经缴纳了"+personaltax+"元个人所得税.");
+            System.out.println("继续查询请输入1");
+            int a=i.nextInt();
+            if (a==1) {
+                n+=0;
+            } else n += 1;
+        }
+        System.out.println("再见!");