标签:
class prut { String MC; double DJ; int SL; public prut(String MC,double DJ,int SL){ this.MC=MC; this.DJ=DJ; this.SL=SL; } }
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); prut[] pr=new prut[n+1]; for(int i=0;i<n;i++){ String t1=sc.next(); double t2=sc.nextDouble(); int t3=sc.nextInt(); pr[i]=new prut(t1,t2,t3); } double ans=0.0; for(int i=0;i<n;i++){ ans+=pr[i].DJ*pr[i].SL; } System.out.printf("%.6f",ans); } sc.close(); } }
标签:
原文地址:http://www.cnblogs.com/watchfree/p/5344575.html