public class sk3 {
public static void main(String[] args){
String huaweibrond="华为手机";
double huaweisize=5.5;
double huaweiprice=3688.88;
String huaweiconfing="4+64g,全面屏";
System.out.println("品牌型号"+huaweibrond);
System.out.println("尺寸"+huaweisize);
System.out.println("价格"+huaweiprice);
System.out.println("配置"+huaweiconfing);
System.out.println("请输入"+huaweibrond+"的库存:");
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
double a=huaweiprice*x;
System.out.println("库存华为手机的金额为:"+a);
String xiaomibrond="小米手机";
double xiaomisize=5.0;
double xiaomiprice=2988.88;
String xiaomiconfing="4+64g,全面屏";
System.out.println("品牌"+xiaomibrond);
System.out.println("尺寸"+xiaomisize);
System.out.println("价格"+xiaomiprice);
System.out.println("配置"+xiaomiconfing);
System.out.println("请输入"+xiaomibrond+"的库存:");
int x1=sc.nextInt();
double a1=xiaomiprice*x1;
System.out.println("库存"+xiaomibrond+"手机的金额为:"+a1);
System.out.println("----------------库存清单-------------------------------");
System.out.println("品牌型号\t尺寸\t\t价格\t\t配置\t库存数量\t总价");
System.out.println(huaweibrond+'\t'+huaweisize+'\t'+ huaweiprice+'\t'+'\t'+huaweiconfing+'\t'+x+'\t'+a);
System.out.println(xiaomibrond+'\t'+xiaomisize+'\t'+ xiaomiprice+'\t'+'\t'+xiaomiconfing+'\t'+x1+'\t'+a1);
System.out.println("--------------------------------------------------------");
System.out.println("总库存:"+(x+x1));
System.out.println("总金额:"+(a+a1)+'$');
}
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/98610522e0044b13aab46131f650073e.png)