Random jump title to jump to this question, I saw a red title, this would konjacHard to think up Pleased to write
This problem can not really use the array, use the array to RE The beginning of the cards in it
To be honest, this question really Difficult Is not difficult, just follow the formula above to set the line
Without further ado, on the code
#include <stdio.h> #include <cstdio> // header files, not to be construed Double A, B, C, D, SUM; // Double lf is in scanf input and output printf int n-, I; int main ( ) { scanf ( " % D " , & n-); // said to use scanf faster for (I = . 1 ; I <= n-; I ++ ) { scanf ( " % LF " , & a); // code I previous post with the array, the result REs C + = a; } for (I = . 1 ; I <= n-; I ++ ) { Scanf ( " % LF " , &B); D + = B; } SUM = (C * . 3 -d * 2 ) / (CD); // can be obtained according to the original formula of the printf ( " % 0.6lf " , SUM); return 0 ; }