• 课堂复习内容(1)


            扫描仪类:

                   import java.util.Scanner;

                  Scanner input=new Scanner(System.in);

            示例:   

                    import java.util.Scanner;

                     public class Test02 {
                       public static void main(String[] args) {
                        Scanner input = new Scanner(System.in);
                       System.out.println("请输入名字:");
                       String name = input.next();
                       System.out.println("请输入年龄:");
                       int age = input.nextInt();
                       System.out.println("请输入性别:");
                      char gehder = input.next().charAt(0);

                       }
                   }

                      获得4位数各位
                        int custNo = input.nextInt();
                       int gewei = custNo % 10;
                      int shiwei = custNo / 10 % 10;
                      int baiwei = custNo / 100 % 10;
                       int qianwei = custNo / 1000;

      

  • 相关阅读:
    Myeclipse快捷键
    Resharper 的快捷键
    jQuery模块自由组合方案
    CTE
    Nhibernate3以上单元测试
    第三方控件下载篇
    10 个 Visual Studio 原生开发的调试技巧
    Nhibernate为hbm.xml配置文件添加智能提示(VS2010)
    Win7下nginx默认80端口被System占用
    Nginx本地配置
  • 原文地址:https://www.cnblogs.com/LWLDD/p/6684539.html
Copyright © 2020-2023  润新知