zoukankan      html  css  js  c++  java
  • java中获取用户输入字符,并将字符大写后显示

    /*
       java 获取输入,大写在显示
        @author:luowen
        @time:2013-10-23
    */
    import java.io.*;
    
    class GetParam
    {
    	public static void main(String[] args)
    	{
    		InputStreamReader isr = null;
    		BufferedReader br = null;
    		try
    		{
    			InputStream in = System.in;
    
    			 isr = new InputStreamReader(in);
    
    			 br = new BufferedReader(isr);
    
    			String line = null;
    
    			while((line = br.readLine()) != null)
    			{
    				if(line.equals("over"))
    								break;
    				System.out.println(line.toUpperCase());
    			}
    
    		}
    		catch(IOException e)
    		{
    			System.out.println(e.toString());
    		}
    		finally
    		{
    			try
    			{
    				br.close();
    			}
    			catch(IOException e)
    			{
    				System.out.println(e.toString());
    			}
    
    		}
    
    	}
    }
    

      

  • 相关阅读:
    HDU4126
    训练赛Day6-The 36th ACMICPC Asia Regional Beijing Site
    弦图
    HDU4821 字符串哈希+尺取
    HDU1854
    HDU1166
    输入输出挂
    LightOj 1027 数学期望
    HDU
    HDU
  • 原文地址:https://www.cnblogs.com/luowen/p/3384734.html
Copyright © 2011-2022 走看看