1103: 平均学分绩点(函数专题)
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int n=cin.nextInt();int sum_credit=0,sum_score=0;for(int i=1;i<=n;i++){
int credit=cin.nextInt();int score=cin.nextInt();sum_credit+=credit;if(score>=60) sum_score+=(score-50)/10*credit;}System.out.printf("%.1f",1.0*sum_score/sum_credit);}
}