1140:0 starting point algorithm 47--averaging

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.