1140:0 starting point algorithm 47--averaging time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:1408 accepted:873
[Submit] [Status] [Web Board] Description
Enter some integers, averaging
Input
Multiple sets of test data
First enter 1 integer n to indicate the number of test groups
Then enter 1 integer m for each line, and then enter M integers
Output
For each set of test data output 1 rows, the content is an average of M integers, leaving 2 decimal places
Sample Input
22 1 25 3 4 6 9 3
Sample Output
1.505.00
Source
0 Starting point Learning algorithm
1#include <stdio.h>2 intMain () {3 intN;4scanf"%d",&n);5 for(intI=1; i<=n;i++){6 intm,s=0;7scanf"%d",&m);8 for(intj=1; j<=m;j++){9 intK;Tenscanf"%d",&k); Ones+=K; A } -printf"%.2f\n", s*1.0/m); - } the - return 0; -}
Casting is not supported.
1140:0 starting point algorithm 47--averaging