/* File name: 5 * Author: ROM * completion date: May 8, 2016 * version number: v1.0 * method and description of task solving: * Input description: int a[10],b[10],c[10],i,m=0,n= 0 * Problem Description: Enter 10 numbers from the keyboard into the array A, the array of odd points into the array B, even into the array C after the output respectively. * Program Output:cout<< "even array c[m]:"; cout<< "Odd Array B[n]:" * Problem analysis: Slightly * algorithmic design: For statement */#include <iostream> using namespace std; int main () {int a[10],b[10],c[10],i,m=0,n=0; cout<< "Please enter 10 number:"; for (i=0;i<=9;i++) {cin>>a[i]; if (a[i]%2==0) {c[m]=a[i]; m++; } else {b[n]=a[i]; n++; }} cout<< "even array c[m]:"; for (i=0;i<m;i++) cout<<c[i]<< ""; cout<<endl; cout<< "Odd Array b[n]:"; for (i=0;i<n;i++) cout<<b[i]<< ""; cout<<endl; return 0; }Third, Experience: Circular statement to pay attention to the relationship between the output, need to practiceFour, the Knowledge point summary: Still must pay attention to I the value range, tries several times more
C + + experiment 5-array separation