⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pro_5.java

📁 java的团队合作代码
💻 JAVA
字号:
package com.jk;
import java.io.* ;
/**
 * 
 * @author 王荣华
 * @date 2008-7-17
 *
 */
class BasicIo
{
    public static int readInteger() throws IOException
    {
    String line ;

    BufferedReader in = new BufferedReader(new
				InputStreamReader(System.in)) ;

    try
        {
        line = in.readLine() ;
        int i = Integer.parseInt(line.trim()) ;
        return i ;
        }
    catch (Exception e)
        {
        throw new IOException("invalid integer") ;
        }
    } // end of method readInteger
}

public class pro_5
{
	public static void main(String[] args)
	{
		System.out.println("输入3位整数");
		int c;
		try
		{
			c=BasicIo.readInteger();
		}
		catch(Exception e)
		{
			System.out.println(e);
			c=0;
			System.exit(1);
		}
		if((c/100)==0||(c/100)>9)System.out.println("不是3位数!");
		boolean ji=false;
		boolean ou=false;
		if((c/100)%2==0)ou=true;
		else ji=true;
		if((c/10)%2==0)ou=true;
		else ji=true;
		if((c%2)==0)ou=true;
		else ji=true;
		if(ou==ji)System.out.println("同时存在基数和偶数");
		else System.out.println("不同时存在基数和偶数");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -