PKU2810:Take Your Vitamins

やるだけ。ArrayList使う理由もそんなにない。

import java.util.*;

class Main{
	public static void main(String args){
		Scanner s=new Scanner(System.in);
		ArrayListle=new ArrayList(0);
		while(true){
			String a=s.nextLine();
			String b=a.split(" ",4);
			double c=(Double.parseDouble(b[0]));
			double d=(Double.parseDouble(b[2]));
			if(c<0.0)break;
			double e=(double)c/(double)d;
			if(e>=0.01){
				System.out.printf("%s %.1f %s %.0f%%\n",b[3],(double)c,b[1],(e*100));
			}else le.add(b[3]);
		}
		if(le.size()>0)System.out.println("Provides no significant amount of:");
		for(int i=0;i