Java第三次作业
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入a值"); int a=input.nextInt(); System.out.println("请输入b值"); int b=input.nextInt(); int c ; c=a; a=b; b=c; System.out.println(a+","+b);
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入a值"); int a=input.nextInt(); System.out.println("请输入b值"); int b=input.nextInt(); System.out.println(a*a+b*b); // TODO Auto-generated method stub }
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入商品单价"); int a=input.nextInt(); System.out.println("请输入商品个数"); int b=input.nextInt(); int c=a*b; System.out.println(c+","+c/10*8); // TODO Auto-generated method stub }
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入一个百位数字"); int a=input.nextInt(); int b=a/100; int c=a/10%10; int d=a%10; System.out.println(b+c+d); // TODO Auto-generated method stub }
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入一个大写字母"); char d =input.next().charAt(0); System.out.println((char)(d+32)); // TODO Auto-generated method stub }
public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入第一个数"); int a=input.nextInt(); System.out.println("请输入第二个数"); int b=input.nextInt(); int c; c=a>b?a:b; System.out.println(c); // TODO Auto-generated method stub }