UVA - 10014 Simple calculations
2014-10-08 00:08
351 查看
#include<cstdio> int main() { int test, n ; double first,last, sum , temp, ans; scanf("%d", &test); while(test--) { scanf("%d", &n); scanf("%lf", &first); scanf("%lf", &last); sum = 0; for(int i = 1; i <= n; i++) { scanf("%lf", &temp); sum = sum + 2.0*(n+1-i)*temp; } double a = n * first + last - sum; printf("%.2lf\n", a / (n+1)); if(test != 0 ) printf("\n"); } return 0; }
题目大意:根据所给的公式求出a1
解題思路:找到公式就可以
相关文章推荐
- uva 10014 Simple calculations
- UVA - 10014 Simple calculations
- UVA - 10014 - Simple calculations (经典的数学推导题!!)
- UVA 10014 Simple calculations
- uva 10014 - Simple calculations
- UVA 10014 - Simple calculations(数学)
- UVA - 10014 Simple calculations
- Uva 10014
- uva 10014 - Simple calculations
- uva 10014
- UVa 10014 - Simple calculations
- uva 10014 Simple calculations
- UVA10014-简单计算
- UVA 10014 简单计算
- UVA 10014(推公式)
- uva10014(数学)
- UVA - 10014 Simple calculations
- UVA 10014(暑假-数学(3) -F - Simple calculations)
- UVa 10014 - Simple calculations
- UVa 10014 - Simple calculations