HDACM 2090
注意:用Scanner类的hasNext()方法来控制循环
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);double sum = 0;while (sc.hasNext()) {sc.next();double amount = sc.nextDouble();double price = sc.nextDouble();sum += amount*price;}System.out.printf("%.1f",sum);System.out.println();sc.close();}
}