题解 | #牛牛的短信#
牛牛的短信
http://www.nowcoder.com/practice/435c9e2bf4f84bee99b82ce84e95b0b7
int main()
{
int a;
int arr[100] = { 0 };
int b = 0;
double sum = 0.0;
int c = 0;
scanf("%d ", &a);
for (;(scanf("%d", &arr[b])) != EOF && c < a;)
{
if (arr[b] <= 60)
{
sum += 0.1;
}
else
{
sum += 0.2;
}
c++;
}
printf("%.1f", sum);
return 0;
}