16 weeks (item 4 Dynamic Array), 16 weeks project Dynamic Array
/*
* Copyright (c) 2014, computer College, Yantai University
* All rights reserved.
* File name: 16 weeks (Project 4 Dynamic Array)
* Author: Wang Zhong
* Completion date: 2014.12.15
* Version: v1.0
*
* Problem description: Add a dynamic array with an appropriate length, copy the data in the original array to the new array, and then enter the new data. The array after adding new data becomes the new array for saving data.
* Description: score, number of students
* Program output: Number of new students
# Include <iostream> using namespace std; int main () {int num, I, addNum; // num is the number of students in the group cout <"Number of Students input :"; cin> num; int * score = new int [num]; cout <"Enter the Student score:"; // enter the score of the student with the num name for (I = 0; I <num; I ++) cin> score [I]; // * (score + I) cout <"how many students need to be added? "; Cin> addNum; // addNum is the number of people to be added. // The following program completes the expansion of the array, and enter another score for (I = num; I <num + addNum; I ++) cin> score [I]; num = num + addNum; cout <"Total" <num <"Name, their scores are: "<endl; for (I = 0; I <num; I ++) cout <score [I] <""; cout <endl; delete [] score; return 0 ;}