简易的四则运算器

import java.util.Scanner;

public class AA {

public static void main(String args[]){

Scanner in=new Scanner(System.in);

System.out.println("请输入a的值:");

int a=in.nextInt();

System.out.println("请输入b的值:");

int b=in.nextInt();

//System.out.print("请输入运算符:");

//String s = in.next();

char z='+';

switch(z){

  case '-':

  System.out.println("a-b值为:"+(a-b));

  break;

  case '+':

  System.out.println("a+b值为:"+(a+b));

  break;

  case '*':

  System.out.println("a*b值为:"+(a*b));

  break;

  case '/':

  System.out.println("a/b值为:"+(a/b));

  break;

}

    }

}


你可能感兴趣的:(速度帮我看看,这样的对你应该很简单的啊。)