zoukankan      html  css  js  c++  java
  • 读取控制台的字符串_方法二

    package com.cici.common;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    
    
    public class SystemIn {
         public static int readInt(){
              BufferedReader br = null;
              try{
               br = new BufferedReader( new InputStreamReader( System.in) ) ;
               String line = br.readLine();
               int ret = Integer.parseInt( line );
               return ret ; 
              }catch( Exception e ){
               e.printStackTrace();
               return -1 ;
              }
             } 
             
             public static double readDouble(){
              BufferedReader br = null;
              try{
               br = new BufferedReader( new InputStreamReader( System.in) ) ;
               String line = br.readLine();
               double ret = Double.parseDouble( line );
               return ret ; 
              }catch( Exception e ){
               e.printStackTrace();
               return -1 ;
              }
             }
             
             public static String readString(){
              BufferedReader br = null;
              try{
               br = new BufferedReader( new InputStreamReader( System.in) ) ;
               String line = br.readLine();
               return line ; 
              }catch( Exception e ){
               e.printStackTrace();
               return null;
              }
             }
            }
    
            class Test{ 
             public static void main( String args[] ){
              int i = SystemIn.readInt();
              double d = SystemIn.readDouble();
              String s = SystemIn.readString();
              System.out.println( i + "	" + d + "	" + s ) ;
             } 
    }
    public class SystemInApp{
     
    public static void main(String[] args) throws Exception {
    
            
            System.out.println("Please insert the pageNO :"); int pageNo =
            SystemIn.readInt();
             
             System.out.println("Please insert the lineMount :"); int lineMount =
             SystemIn.readInt();
             
             System.out.println("Please insert the listMount :"); int listMount =
             SystemIn.readInt();
     
        
    }
  • 相关阅读:
    使用片段嵌入进行文档搜索
    详解支持向量机
    使用NLP检测和对抗AI生成的假新闻
    Detectron2 API 之 config | 十五
    用Python可视化卷积神经网络
    六种用于文本分类的开源预训练模型
    解空间树(回溯算法,分支界限法)
    日记2
    C编程(C语言程序设计,大连理工大学MOOC)
    编程题(C/C++程序设计,同济大学mooc)
  • 原文地址:https://www.cnblogs.com/cici-new/p/3164218.html
Copyright © 2011-2022 走看看