I. Questions and codes
/** file Name: C + + experiment 5* : Chen Guanxin * Completion date: 2016 May 8th * Version number: v1.0* Description of task and solution method part: Array separation * Input Description: * Problem Description: Enter 10 numbers in the array from the keyboard A, the odd number in the array is placed in array B, the even number is placed in the array C and then output separately. * Program Output: * Problem Analysis: * Algorithm design: */#include <iostream>using namespace Std;int main () {const int n=10;inta[n],b[n],c[n],i,j=0,k =0;for (i=0;i<n;i++) {cin>>a[i];if (a[i]%2==0) {b[j]=a[i];j++;} else{c[k]=a[i];k++;}} cout<< "even array:"; for (i=0;i<j;i++) cout<<b[i]<< ",";cout<< "odd array:"; for (i=0;i<k;i++) cout<<c[i]<< ","; return 0;}Second, operation and results
Third, experience
Feeling array This chapter is difficult to understand, it also requires me to slowly digest
Iv. Summary of Knowledge points
One-dimensional arrays
C + + experiment 5-array separation