PAT(Basic Level)_1049_数列的片段和
#include<stdio.h>int main(){ int N; scanf("%d",&N); double sum=0,tmp; for(int i=0;i<N;i++){ scanf("%lf",&tmp); sum+=tmp*(i+1)*(N-i); } printf("%.2lf",sum); ret