http://acm.hdu.edu.cn/showproblem.php?pid=2061
这题很简单。注意换行。
<span style="font-size:18px;">#include <stdlib.h>
#include <stdio.h>
int main()
{
int s,t,i;
char a[50];
double x,y;
double m,n;
bool f;
double z;
scanf("%d",&s);
while (s--)
{
f = true;
m = 0;n = 0;
scanf("%d",&t);
for (i=0;i<t;i++)
{
scanf("%s%lf%lf",a,&x,&y);
if (y<60)
f = false;
m = m+x;
n = n+y*x;
}
z = n/m;
if (f)
printf("%.2lf\n",z);
else
printf("Sorry!\n");
if (s)
printf("\n");
}
return 0;
}</span>