count.java

来自「是一个综合开发程序,可以做为系统研究人员的参考」· Java 代码 · 共 65 行

JAVA
65
字号
yimport java.io.*;
class count{
static int a,b,c;

	public static void main(String[] args){
		try{
		     InputStreamReader in =new InputStreamReader(System.in);
		     InputStreamReader ine= new InputStreamReader(System.in);
		     //InputStreamReader inr= new InputStreamReader(System.in);
		     BufferedReader one =new BufferedReader(in);
		     BufferedReader tow =new BufferedReader(ine);
		    // BufferedReader three =new BufferedReader(inr);
		     System.out.println("please input your first number:");
		     a=Integer.parseInt(one.readLine());
		     
		     System.out.println("please input your second number:");
		     b=Integer.parseInt(tow.readLine());
		     //System.out.println("please input opert:");
		     //c=Integer.parseInt(three.readLine());
		     
		     sum count =new sum(a,b);
		     //count.counter(a,b);
		     System.out.println("the end ");
		     
	}
	catch(IOException e){
		//e.getMessgae();
	//	System.out.println("你输入的不是数据在是其它的字符,请检查:");
	}
	
	}
	
}
  class sum{
//public int a,b,c,d;
public int a,b;

  	public sum(int x,int y){
		 
			this.a=x;
			this.b=y;
			System.out.println("两数的和为:"+(a+b));
		   /* this.c=z;
//	switch(c){
			//	case '1':   
				d = a + b;
				System.out.println("两数的和为:"+d);break;
				case '2': 
				d = a - b;
				  System.out.println("两数的差为:"+d);break;
				case '3':  
				d = a*b ;
				 System.out.println("两数的积为:"+d);break;
				case '4':  
				d= a / b;
				 System.out.println("两数的商为:"+d);break;
				 
			default :System.out.println("you input must be the right:");
			}*/
			
		
}

			
		}

⌨️ 快捷键说明

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