I. Questions and codes
/*02.* file name: Using the Loop summation 03.* : Yuval 04.* Completion Date: May 8th 05.* version number: v1.006.* Description of Task and Solution Method Section: 07.* Input Description: 08.* problem Description: Slightly 09.* program output: Odd even split 10.* problem analysis: Slightly 11.* algorithm design: The following 12.*/#include <iostream>using namespace Std;int main () { const int n=10; int b,i,k,j,l,a[10],b[10],c[10]; int o=0,p=0; cout<< "Please enter 10 numbers" <<endl; for (i=0;i<n;i++) {cin>>b; a[i]=b;} for (k=0;k<n;k++) {if (a[k]%2==0) {c[o]=a[k]; o=o+1;} else {b[p]=a[k];p =p+1;}} for (j=0;j<p;j++) cout<<b[j]<< ""; cout<<endl; for (l=0;l<o;l++) cout<<c[l]<< ""; cout<<endl<< "Thank you for using this program";}
Two. Running results
Third, experience
Arrays are still not very skilled and need a lot of practice.
Iv. Summary of Knowledge points
Array use must first define the number of
C + + 5th time on-machine experiment: array separation