package Home;
import java.util.Scanner;
public class Home {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("请输入单品价格");
double price=input.nextDouble();
System.out.println("请输入数量");
int num=input.nextInt();
double sum,discount;
sum=price*num;
discount=0.8*sum;
System.out.println("总价为"+sum+"\t"+"折后价为"+(int)discount);
System.out.println("求输入付款金额");
int pay=input.nextInt();
System.out.println("找零:"+(pay-(int)discount));
}
}
![](https://img2020.cnblogs.com/blog/2318909/202103/2318909-20210326172710923-324800645.png)
package Home2;
import java.util.Scanner;
public class Home2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("请输入数字");
int num=input.nextInt();
int a,b,c;
a=num/100;
b=num/10%10;
c=num%10;
System.out.println("百位数字为"+a+"\t"+"十位数字位"+b+"\t"+"个位数字为"+c);
}
}
![](https://img2020.cnblogs.com/blog/2318909/202103/2318909-20210326172759790-547704940.png)
package Home3;
import java.util.Scanner;
import java.util.regex.Pattern;
public class Home3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("请输入大写字母");
char c=input.next().charAt(0);
System.out.println("对应的小写字母是"+(char)(c+32));
}
}
![](https://img2020.cnblogs.com/blog/2318909/202103/2318909-20210326172840590-358895405.png)
package Home4;
import java.util.Scanner;
public class Home4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("输入两个数字");
int a=input.nextInt();
int b=input.nextInt();
int c;
c=a>b?a:b;
System.out.println(c);
}
}
![](https://img2020.cnblogs.com/blog/2318909/202103/2318909-20210326173147132-1212571434.png)