I. Questions and codes
/* File name: 0510.cpp * Creator: liuqing Rain * Completion Date: May 10 * Version number: v1.0 * Description of task and solution method part: Using array to split odd even; * input Description: Enter 10 numbers; * Problem Description: Enter 10 numbers from the keyboard in the array A, put the odd number in the array B, the even in the array c, and then output separately. * Program output: Output the odd and even numbers in the array respectively; * Problem analysis: Judging parity and classifying it; * Algorithm design: Slightly */#include <iostream>using namespace Std;int main () {int a[10],b[1 0],c[10],m=0,n=0,k=0,j=0,i; cout<< "Please enter 10 number:"; for (i=0;i<=9;i++) {cin>>a[i];if (a[i]%2!=0) b[m++]=a[i],k++;elsec[n++]=a[i],j++;} if (k>0) {cout<< "odd group:"; for (m=0;m<k;m++) cout<<b[m]<< "" <<endl;} else cout<< "No odd number in this group" <<endl;if (j>0) {cout<< "even group:"; for (n=0;n<j;n++) cout<<c[n]< < "" <<ENDL; else cout<< "No odd number in this group" <<endl;return 0;}
ii. Results of Operation
Iii. Summary of Knowledge points
How to handle various array problems
Iv. Experience
Rigorous, careful, reduce the error rate in the process
C + + experiment 5-array separation