import java.util.Scanner;/** * 华为机试 自动售货机 * 不知道对错 * @author qxl * */public class Shop { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int price1 = 2, s_count1 = 5; int price2 = 3, s_count2 = 10; int price3 = 4, s_count3 = 14;//初始化 int y_count1 = 5; int y_count2 = 5; int y_count5 = 3; while (sc.hasNext()) { String s = sc.nextLine();//p 5,p 5,p 5,b A3,b A3,b A2 s = s.replace(" ", ",");//p,5,p,5,p,5,b,A3,b,A3,b,A2 String[]str = s.split(",");//{"p","5","p","5","p","5","b","A3","b","A3","b","A2"} int total_pay = 0; int total_cost = 0; for(int i=0;i