Personal assignments-Data summation

Source: Internet
Author: User

1. The first version of the program PROG1:
+ Given an array, implements the sum of the elements of the array, and specifically requires that all elements of a one-dimensional array (a[100]) be added.
+ Data Preparation: A) array length : 100;b) array data source : Experimental Data A column: 1~100,csv format fills the first 100 data.

2. The second version of the program PROG2:
+ Rewrite into a function (called arraysum), can realize the sum of all elements of any length array;
+ Data Preparation: A) array length : arbitrary; b) array data source : Experimental data column A.

3. Third version of the program Prog3:
+ Prog2 rewrite to be able to read data from a file, implement any length array, add elements within the specified range.
+ Data Preparation: A) array length : arbitrary; b) array data source : read from file.

As the C + + book has not been seen and used for a long time, so this homework took a long period. has been flipping through the contents of the array and function sections of the book. As for the format of the imported experimental data, the conversion to text documents and other errors that occur during the course of the operation is through the modification of their own, run a number of attempts, plus the student guidance made out.

Github Link: https://github.com/chenxin666/-

Personal assignments-Data summation

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.